forked from HPR/hpr_generator
Compare commits
10 Commits
c9e1446f1f
...
main
Author | SHA1 | Date | |
---|---|---|---|
2e43f79d52 | |||
|
00ab3b3065 | ||
|
4af0c021eb | ||
|
3abeb25b03 | ||
|
e2fd890669 | ||
e21f434c2a | |||
e2c591edff | |||
28a75efe1b | |||
94baef679f | |||
11738f5052 |
@@ -111,7 +111,7 @@ file are found in the comments within the file.
|
|||||||
|
|
||||||
Any database supported by the Perl:DBI and Perl::DBD modules can be used with
|
Any database supported by the Perl:DBI and Perl::DBD modules can be used with
|
||||||
the site-generator program. Currently the hpr_generator project works with
|
the site-generator program. Currently the hpr_generator project works with
|
||||||
a MySQL or SQLite database.
|
an SQLite database.
|
||||||
|
|
||||||
Find the [DBI] section of the file. It should look like the following
|
Find the [DBI] section of the file. It should look like the following
|
||||||
|
|
||||||
@@ -146,26 +146,6 @@ The hpr.db section of the driver option `dbi:SQLite:hpr.db` is the path
|
|||||||
to the sqlite file. The default assumes the hpr.db file is located in the same
|
to the sqlite file. The default assumes the hpr.db file is located in the same
|
||||||
directory as the site-generator.
|
directory as the site-generator.
|
||||||
|
|
||||||
### MySQL
|
|
||||||
|
|
||||||
Remove the comment character from the start of the database, driver,
|
|
||||||
user, and password option lines:
|
|
||||||
|
|
||||||
```
|
|
||||||
# Configuration settings for MySQL
|
|
||||||
database: mysql
|
|
||||||
driver: dbi:mysql:database=hpr_hpr:hostname=localhost
|
|
||||||
user: hpr-generator
|
|
||||||
password: *********
|
|
||||||
```
|
|
||||||
|
|
||||||
This assumes that the MySQL database service is available at the localhost
|
|
||||||
hostname, that the database name (hpr_hpr) is the database created from
|
|
||||||
the hpr.sql dump file or manually created by you, that the user (hpr-generator)
|
|
||||||
was added by you and has read rights to the hpr_hpr database, and that the
|
|
||||||
password (replace ********* with the actual password) matches the password set
|
|
||||||
for the hpr-generator database user.
|
|
||||||
|
|
||||||
## Configuring the website for viewing locally
|
## Configuring the website for viewing locally
|
||||||
|
|
||||||
For HTML links to work when viewing the files on your local machine using the
|
For HTML links to work when viewing the files on your local machine using the
|
||||||
|
13
README.md
13
README.md
@@ -15,15 +15,6 @@ Static web page generator for the Hacker Public Radio website.
|
|||||||
2. Run `./utils/update-hpr.sh`
|
2. Run `./utils/update-hpr.sh`
|
||||||
* SQLite v3.8.3 or greater is recommended. CTE WITH clauses are used in some template queries. Must convert WITH
|
* SQLite v3.8.3 or greater is recommended. CTE WITH clauses are used in some template queries. Must convert WITH
|
||||||
clauses to sub-queries when using earlier versions of SQLite.
|
clauses to sub-queries when using earlier versions of SQLite.
|
||||||
* With MySQL
|
|
||||||
* Create database hpr_hpr in the MySQL server from HPR dump file.
|
|
||||||
- ``sudo mysql --host=localhost < hpr.sql``
|
|
||||||
* Create a user that will be used by the site-generator.
|
|
||||||
- Suggested username: hpr-generator
|
|
||||||
- ``CREATE USER 'hpr-generator'@'localhost' IDENTIFIED BY '<password>';``
|
|
||||||
* Limit the user's privileges to EXECUTE and SELECT
|
|
||||||
- ``GRANT SELECT ON hpr_hpr.* TO 'hpr-generator'@'localhost';``
|
|
||||||
- ``GRANT EXECUTE ON `hpr_hpr`.* TO 'hpr-generator'@'localhost';``
|
|
||||||
* Install the needed Perl modules using preferred method (distribution packages, CPAN, etc.)
|
* Install the needed Perl modules using preferred method (distribution packages, CPAN, etc.)
|
||||||
* Getopt::Long
|
* Getopt::Long
|
||||||
* Pod::Usage
|
* Pod::Usage
|
||||||
@@ -35,7 +26,7 @@ Static web page generator for the Hacker Public Radio website.
|
|||||||
* Template::Plugin::HTML::Strip
|
* Template::Plugin::HTML::Strip
|
||||||
* DBI
|
* DBI
|
||||||
* Tie::DBI
|
* Tie::DBI
|
||||||
* DBD::SQLite or DBD::mysql
|
* DBD::SQLite
|
||||||
* Date::Calc
|
* Date::Calc
|
||||||
* Text::CSV_XS
|
* Text::CSV_XS
|
||||||
* HTML::Entities
|
* HTML::Entities
|
||||||
@@ -76,4 +67,6 @@ and add the label "**Feature Request**".
|
|||||||
* gordons
|
* gordons
|
||||||
* Ken Fallon
|
* Ken Fallon
|
||||||
* norrist
|
* norrist
|
||||||
|
* Paul Jewell
|
||||||
|
|
||||||
|
|
||||||
|
@@ -56,19 +56,9 @@ Perl Template Toolkit.
|
|||||||
* SQLite v3.8.3 or greater is recommended. CTE WITH clauses are used in some template queries.
|
* SQLite v3.8.3 or greater is recommended. CTE WITH clauses are used in some template queries.
|
||||||
Must convert WITH clauses to sub-queries when using earlier versions of SQLite.
|
Must convert WITH clauses to sub-queries when using earlier versions of SQLite.
|
||||||
|
|
||||||
With MySQL
|
|
||||||
* Create database hpr_hpr in the MySQL server from HPR dump file.
|
|
||||||
- sudo mysql --host=localhost < hpr.sql
|
|
||||||
* Create a user that will be used by the site-generator.
|
|
||||||
- Suggested username: hpr-generator
|
|
||||||
- CREATE USER 'hpr-generator'@'localhost' IDENTIFIED BY '<password>';
|
|
||||||
* Limit the user's privileges to EXECUTE and SELECT
|
|
||||||
- GRANT SELECT ON hpr_hpr.* TO 'hpr-generator'@'localhost';
|
|
||||||
- GRANT EXECUTE ON `hpr_hpr`.* TO 'hpr-generator'@'localhost';
|
|
||||||
|
|
||||||
Install the needed Perl modules using preferred method (distribution packages, CPAN, etc.)
|
Install the needed Perl modules using preferred method (distribution packages, CPAN, etc.)
|
||||||
* Config::Std
|
* Config::Std
|
||||||
* DBD::SQLite or DBD:mysql
|
* DBD::SQLite
|
||||||
* DBI
|
* DBI
|
||||||
* Data::Dumper
|
* Data::Dumper
|
||||||
* Date::Calc
|
* Date::Calc
|
||||||
|
@@ -872,42 +872,17 @@
|
|||||||
Your audio is completely inaccessible to those who have hearing problems,
|
Your audio is completely inaccessible to those who have hearing problems,
|
||||||
so the only way for your show to be of help to them is if you distill the essence of the show into the show notes.
|
so the only way for your show to be of help to them is if you distill the essence of the show into the show notes.
|
||||||
If you are using a script to prepare your show then include that.</li>
|
If you are using a script to prepare your show then include that.</li>
|
||||||
|
<li><strong>Adding the shownotes</strong>
|
||||||
|
<ul>
|
||||||
|
<li>Add text and use the WYSIWYG editor buttons to add additional formatting</li>
|
||||||
|
<li>Optionally - You can paste in <strong>Rendered</strong> HTML</li>
|
||||||
|
<li><strong>Do not paste un-rendored markup (HTML, Markdown,
|
||||||
|
RestructuredText)</strong> unless your intention is to have un-rendored
|
||||||
|
markup as shownotes.</li>
|
||||||
|
<li>The amount you can enter is restricted to 4000 characters, but you can provide additional show notes if you wish.
|
||||||
|
Please add them to an full_shownotes.html file which you can expect to be served from
|
||||||
|
<!--% absolute_url(baseurl) %-->eps/hpr9999/full_shownotes.html</li>
|
||||||
</ul>
|
</ul>
|
||||||
The amount you can enter is restricted to 4000 characters, but you can provide additional show notes if you wish.
|
|
||||||
Please add them to an full_shownotes.html file which you can expect to be served from
|
|
||||||
<!--% absolute_url(baseurl) %-->eps/hpr9999/full_shownotes.html<br /> <br />
|
|
||||||
<li>
|
|
||||||
If you wish to include text formatting then please use a format that supports it. We accept:
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>HTML5</li>
|
|
||||||
<li>Markdown (standard)</li>
|
|
||||||
<li>Markdown (GitHub flavoured)</li>
|
|
||||||
<li>Markdown (Pandoc flavoured)</li>
|
|
||||||
<li>RestructuredText</li>
|
|
||||||
<li>txt2tags</li>
|
|
||||||
<li>Plain text</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
However please restrict yourself to text unless you are experienced producing valid markdown/HTML5.
|
|
||||||
Regardless of the format you send your shownotes will end up in html5 <article> section,
|
|
||||||
where the header and footer are not available to you. Avoid using <div> or <span>.
|
|
||||||
The inclusion of JavaScript will send your show into quarantine, until an experienced HPR volunteer
|
|
||||||
can be found to debug it.<br />
|
|
||||||
It takes us a lot longer to fix incorrectly formatted shownotes than plain text, so please only create formatted
|
|
||||||
show notes if you know what you are doing and are sure that what you are writing is valid.
|
|
||||||
</li>
|
|
||||||
<li id="shownotes_format"><strong>Show Note Format:</strong> <em>Optional</em><br />
|
|
||||||
Please tell us which format, if any you used when filling in your shownotes.
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://www.w3schools.com/html/default.asp">HTML5</a></li>
|
|
||||||
<li><a href="https://en.wikipedia.org/wiki/Markdown">Markdown (standard)</a></li>
|
|
||||||
<li><a href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax">Markdown (GitHub flavoured)</a></li>
|
|
||||||
<li><a href="https://pandoc.org/MANUAL.html#pandocs-markdown">Markdown (Pandoc flavoured)</a></li>
|
|
||||||
<li><a href="https://docutils.sourceforge.io/docs/user/rst/quickstart.html">RestructuredText</a></li>
|
|
||||||
<li>Plain text having no formatting.</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li id="series"><strong>Series:</strong> <em>Optional</em><br />
|
<li id="series"><strong>Series:</strong> <em>Optional</em><br />
|
||||||
Select the <a href="<!--% absolute_url(baseurl) %-->series/index.html">series</a> if any that your show is a part of.
|
Select the <a href="<!--% absolute_url(baseurl) %-->series/index.html">series</a> if any that your show is a part of.
|
||||||
|
@@ -1,73 +1,67 @@
|
|||||||
#!/bin/bash -
|
#!/bin/bash -
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
#
|
||||||
# FILE: check-dependencies.sh
|
# FILE: check-dependencies.sh
|
||||||
#
|
#
|
||||||
# USAGE: ./check-dependencies.sh
|
# USAGE: ./check-dependencies.sh
|
||||||
#
|
#
|
||||||
# DESCRIPTION: Check that Perl module dependencies for the hpr_generator
|
# DESCRIPTION: Check that Perl module dependencies for the hpr_generator
|
||||||
# are installed.
|
# are installed.
|
||||||
#
|
#
|
||||||
# OPTIONS: ---
|
# OPTIONS: ---
|
||||||
# REQUIREMENTS: ---
|
# REQUIREMENTS: ---
|
||||||
# BUGS: ---
|
# BUGS: ---
|
||||||
# NOTES: ---
|
# NOTES: ---
|
||||||
# AUTHOR: Roan "Rho`n" Horning (roan.horning@gmail.com)
|
# AUTHOR: Roan "Rho`n" Horning (roan.horning@gmail.com)
|
||||||
# ORGANIZATION:
|
# ORGANIZATION:
|
||||||
# CREATED: 09/05/2024 09:55:00 PM
|
# CREATED: 09/05/2024 09:55:00 PM
|
||||||
# REVISION: ---
|
# REVISION: ---
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|
||||||
set -o nounset # Treat unset variables as an error
|
set -o nounset # Treat unset variables as an error
|
||||||
|
|
||||||
#--- FUNCTION ----------------------------------------------------------------
|
#--- FUNCTION ----------------------------------------------------------------
|
||||||
# NAME: is_module_installed
|
# NAME: is_module_installed
|
||||||
# DESCRIPTION: Tests if the supplied module is found on the system
|
# DESCRIPTION: Tests if the supplied module is found on the system
|
||||||
# PARAMETERS: Name of the denpendent Perl module
|
# PARAMETERS: Name of the denpendent Perl module
|
||||||
# RETURNS: 0 if not found, 1 if found
|
# RETURNS: 0 if not found, 1 if found
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
function is_module_installed {
|
function is_module_installed {
|
||||||
HR="----------------------"
|
HR="----------------------"
|
||||||
perl -e "use ${1} "
|
perl -e "use ${1} "
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]; then
|
||||||
then
|
echo ${HR}
|
||||||
echo ${HR}
|
else
|
||||||
else
|
echo "Found module ${1}"
|
||||||
echo "Found module ${1}"
|
echo ${HR}
|
||||||
echo ${HR}
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MODULES=( \
|
MODULES=(
|
||||||
"Getopt::Long" \
|
"Getopt::Long"
|
||||||
"Pod::Usage" \
|
"Pod::Usage"
|
||||||
"Config::Std" \
|
"Config::Std"
|
||||||
"Template" \
|
"Template"
|
||||||
"Template::Plugin::File" \
|
"Template::Plugin::File"
|
||||||
"Template::Plugin::DBI" \
|
"Template::Plugin::DBI"
|
||||||
"Template::Plugin::HTML::Strip" \
|
"Template::Plugin::HTML::Strip"
|
||||||
"DBI" \
|
"DBI"
|
||||||
"Tie::DBI" \
|
"Tie::DBI"
|
||||||
"DBD::SQLite" \
|
"DBD::SQLite"
|
||||||
"DBD::mysql" \
|
"Date::Calc"
|
||||||
"Date::Calc" \
|
"Text::CSV_XS"
|
||||||
"Text::CSV_XS" \
|
|
||||||
)
|
)
|
||||||
|
|
||||||
echo "The following modules must be installed for the site-generator to function: "
|
echo "The following modules must be installed for the site-generator to function: "
|
||||||
for module in "${MODULES[@]}"
|
for module in "${MODULES[@]}"; do
|
||||||
do
|
echo "* ${module}"
|
||||||
echo "* ${module}"
|
|
||||||
done
|
done
|
||||||
echo "When MySQL is used, the DBD:mysql module is required (otherwise it is optional)"
|
|
||||||
echo "When SQLite is used, then the DBD:SQLite module is required (otherwise it is optional)"
|
|
||||||
|
|
||||||
echo "Scanning for modules ..."
|
echo "Scanning for modules ..."
|
||||||
echo "----------------------"
|
echo "----------------------"
|
||||||
|
|
||||||
for module in "${MODULES[@]}"
|
for module in "${MODULES[@]}"; do
|
||||||
do
|
is_module_installed "${module}"
|
||||||
is_module_installed "${module}"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Finished scanning."
|
echo "Finished scanning."
|
||||||
|
Reference in New Issue
Block a user