diff options
-rwxr-xr-x | libreboot | 4 | ||||
-rwxr-xr-x | libs/project | 14 | ||||
-rwxr-xr-x | libs/tool | 14 | ||||
-rw-r--r-- | www/Makefile | 21 | ||||
-rwxr-xr-x | www/publish.sh | 8 |
5 files changed, 35 insertions, 26 deletions
@@ -26,7 +26,7 @@ libreboot_usage() { printf '\n%s\n' 'Generic project actions:' >&2 - for action in ${PROJECT_ACTIONS_GENERIC}; do + for action in "${PROJECT_ACTIONS_GENERIC[@]}"; do printf '%s\n' " ${action}" >&2 done @@ -46,7 +46,7 @@ libreboot_usage() { printf '\n%s\n' 'Generic tool actions:' >&2 - for action in ${TOOL_ACTIONS_GENERIC}; do + for action in "${TOOL_ACTIONS_GENERIC[@]}"; do printf '%s\n' " ${action}" >&2 done diff --git a/libs/project b/libs/project index d2779224..0f30ace3 100755 --- a/libs/project +++ b/libs/project @@ -15,9 +15,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -PROJECT_ACTIONS_GENERIC="usage download extract update build install release clean" -PROJECT_ACTIONS_HELPERS="arguments" -PROJECT_FUNCTIONS=$( for action in $PROJECT_ACTIONS_GENERIC ; do printf '%s\n' "$action" "$action""_check" ; done ; printf '%s\n' "$PROJECT_ACTIONS_HELPERS" ) +PROJECT_ACTIONS_GENERIC=(usage download extract update build install release clean) +PROJECT_ACTIONS_HELPERS=(arguments) +PROJECT_ACTIONS_FUNCTIONS=( + "${PROJECT_ACTIONS_GENERIC[@]}" + "${PROJECT_ACTIONS_GENERIC[@]/%/_check}" + "${PROJECT_ACTIONS_HELPERS[@]}" +) INSTALL_REGEX="\([^:]*\):\(.*\)" @@ -26,7 +30,7 @@ project_include() { local project_path=$( project_path "$project" ) - unset -f $PROJECT_FUNCTIONS + unset -f "${PROJECT_ACTIONS_FUNCTIONS[@]}" . "$project_path/$project" @@ -562,7 +566,7 @@ project_usage_actions() { printf '\n%s\n' 'Generic actions:' ( - for action in ${PROJECT_ACTIONS_GENERIC}; do + for action in "${PROJECT_ACTIONS_GENERIC[@]}"; do if function_check "${action}"; then printf '%s\n' " ${action}" fi @@ -15,16 +15,20 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -TOOL_ACTIONS_GENERIC="usage update execute" -TOOL_ACTIONS_HELPERS="arguments" -TOOL_FUNCTIONS=$( for action in $TOOL_ACTIONS_GENERIC ; do printf '%s\n' "$action" "$action""_check" ; done ; printf '%s\n' "$TOOL_ACTIONS_HELPERS" ) +TOOL_ACTIONS_GENERIC=(usage update execute) +TOOL_ACTIONS_HELPERS=(arguments) +TOOL_ACTIONS_FUNCTIONS=( + "${TOOL_ACTIONS_GENERIC[@]}" + "${TOOL_ACTIONS_GENERIC[@]/%/_check}" + "${TOOL_ACTIONS_HELPERS[@]}" +) tool_include() { local tool=$1 local tool_path=$( tool_path "$tool" ) - unset -f $TOOL_FUNCTIONS + unset -f "${TOOL_ACTIONS_FUNCTIONS[@]}" . "$tool_path/$tool" @@ -236,7 +240,7 @@ tool_usage_actions() { printf '\n%s\n' 'Generic actions:' - for action in $TOOL_ACTIONS_GENERIC + for action in "${TOOL_ACTIONS_GENERIC[@]}" do if function_check "$action" then diff --git a/www/Makefile b/www/Makefile index bcf230b1..10eb66fc 100644 --- a/www/Makefile +++ b/www/Makefile @@ -18,26 +18,27 @@ HTML_MAIN = $(MD_MAIN:.md=.html) MD_NEWS != cat news/MANIFEST HTML_NEWS = $(MD_NEWS:.md=.html) +HTML_BARE_NEWS = $(MD_NEWS:.md=.bare.html) -# news/index.html implies the building of $(HTML_NEWS). -all: $(HTML_MAIN) news/index.html +# news/index.html implies the building of $(HTML_BARE_NEWS). +all: $(HTML_MAIN) $(HTML_NEWS) news/index.html -.SUFFIXES: .md .html -# Does not apply for news/index.md; see below. +.SUFFIXES: .md .html .bare.html .md.html: ./publish.sh $< +.md.bare.html: + pandoc $(<) > $(<:.md=.bare.html) + # Unlike all the other markdown files, news/index.md does not exist at first: -# it must be generated by index.sh. Also note that index.sh depends on the -# existence of the HTML version of all news items, hence the dependency line -# below. -news/index.md: $(HTML_NEWS) +# it must be generated by index.sh. Also note that index.sh generates the RSS +# feed, which requires the bare HTML versions of all news items. +news/index.md: $(HTML_BARE_NEWS) ./index.sh clean: - rm -f $(HTML_MAIN) $(HTML_MAIN:.html=.bare.html) \ - $(HTML_NEWS) $(HTML_NEWS:.html=.bare.html) \ + rm -f $(HTML_MAIN) $(HTML_NEWS) $(HTML_BARE_NEWS) \ news/index.md news/index.html news/index.bare.html \ feed.xml news/feed.xml diff --git a/www/publish.sh b/www/publish.sh index 8e25d920..9a8a6abc 100755 --- a/www/publish.sh +++ b/www/publish.sh @@ -70,12 +70,12 @@ TOC=$(grep -q "^x-toc-enable: true$" "$TMPFILE" && printf '%s\n' "--toc --toc-de SMART=$(pandoc -v | grep -q '2\.0' || printf '%s\n' "--smart") || SMART="" # chuck through pandoc -pandoc $TOC $SMART "$TMPFILE" -s --css /global.css "$OPTS" \ +# +# $OPTS must not be quoted, otherwise pandoc interprets '--css /headercenter.css' +# as one argument, when it is actually two. +pandoc $TOC $SMART "$TMPFILE" -s --css /global.css $OPTS \ --template template.html --metadata return="$RETURN" > "$FILE.html" -# additionally, produce bare file for RSS -pandoc "$1" > "$FILE.bare.html" - # generate section title anchors as [link] sed -i -e 's_^<h\([123]\) id="\(.*\)">\(.*\)</h\1>_<div class="h"><h\1 id="\2">\3</h\1><a aria-hidden="true" href="#\2">[link]</a></div>_' "$FILE.html" |