From ab853256f4f690e5048aa668821ce3134b4eb033 Mon Sep 17 00:00:00 2001 From: Joan Josep Ordinas Rosa Date: Mon, 3 Dec 2018 18:05:35 +0100 Subject: [PATCH] Removed dot for snippets --- bin/jqt | 2 +- bin/sake | 97 +++++++++++++++++++----------- docs/blocks/content/style.css | 4 ++ docs/blocks/license/markup.html | 2 +- docs/blocks/repository/markup.html | 2 +- docs/blocks/repository/style.css | 4 ++ docs/blocks/toc/markup.html | 2 +- docs/content/content.md | 4 +- docs/content/opt/D.txt | 4 +- docs/content/opt/L.txt | 2 +- docs/content/opt/S.txt | 2 +- docs/content/opt/i.txt | 2 +- docs/content/opt/j.txt | 4 +- docs/content/opt/p.txt | 2 +- share/sake.d/phase3.jq | 6 +- 15 files changed, 87 insertions(+), 52 deletions(-) diff --git a/bin/jqt b/bin/jqt index 205ed96..65aa710 100755 --- a/bin/jqt +++ b/bin/jqt @@ -546,7 +546,7 @@ Usage: jqt [-h | -p | -V ] Some of the options include: Preprocessor options Data options - -D NAME=VAL -M NAME:FILE + -D NAME=STRING -M NAME:FILE -I DIRECTORY -m NAME:FILE -P LANGUAGE Debugging options Template options -C diff --git a/bin/sake b/bin/sake index 2524326..82f957e 100755 --- a/bin/sake +++ b/bin/sake @@ -33,11 +33,50 @@ if test ! -e Sakefile; then fi # Configuration file must exist -if test ! -e config.yaml && test ! -e config.json; then +if test -e config.yaml; then + CONFIGURATION_FILE=config.yaml +elif test -e config.json; then + CONFIGURATION_FILE=config.json +else echo 1>&2 "sake: no \`config.yaml\` or \`config.json\` file found." exit 1 fi +######################################################################## +# Commands +######################################################################## + +list() { + make -f Sakefile -np 2>&1 | + grep -v '^[SmM]akefile' | + awk '/^[^ \t.%][-A-Za-z0-9_.]*:/ { print $1 }' | + sort --unique | + sed 's/:\+$//' | + pr --omit-pagination --width=50 --columns=4 --across +} + +help() { + echo 'Usage: sake [command] [[options] [variable=definition] ...]' + echo -e '\nCommands, builtin and user defined:\n' + list + echo -e '\nSee the manpage for full documentation.' +} + +dag() +{ + make -f Sakefile -Bdn \ + | sed -n \ + -e "s/'//g" \ + -e 's/\.$//' \ + -e 's/Considering target file //p' +} + +new() +{ + local name=$1 kind=$2 + echo 1>&2 "sake: Target \`new\` not implemented." +} + ######################################################################## # Run ######################################################################## @@ -57,47 +96,35 @@ alias _sake='exec make "${makeflags[@]}"' # Run _sake case $1 in - help) - echo 'Usage: sake [command] [[options] [variable=definition] ...]' - echo -e '\nCommands, builtin and user defined:\n' - ;& # fall through - list) - make -f Sakefile -np 2>&1 | - grep -v '^[SmM]akefile' | - awk '/^[^ \t.%][-A-Za-z0-9_.]*:/ { print $1 }' | - sort --unique | - sed 's/:\+$//' | - pr --omit-pagination --width=50 --columns=4 --across - [[ $1 == help ]] && { - echo -e '\nSee the manpage for full documentation.' - } + help) help ;; - clober) - shift - _sake clobber "$@" + list) list ;; - config) - shift - _sake configure "$@" - ;; - dag) - make -f Sakefile -Bdn \ - | sed -n \ - -e "s/'//g" \ - -e 's/\.$//' \ - -e 's/Considering target file //p' + dag) dag ;; new) - echo 1>&2 "sake: Target \`new\` not implemented." - exit 1 + shift + name=site kind=simple + while (( $# > 0 )); do + case "$1" in + name=?*) eval "$1"; shift ;; + kind=?*) eval "$1"; shift ;; + *) break 2 ;; # error? + esac + done + new $name $kind ;; touch) - if test -e config.yaml; then touch config.yaml; else touch config.json; fi - shift - _sake build "$@" + touch $CONFIGURATION_FILE + shift; _sake build "$@" + ;; + clober) + shift; _sake clobber "$@" + ;; + config) + shift; _sake configure "$@" ;; - *) - _sake "$@" + *) _sake "$@" ;; esac diff --git a/docs/blocks/content/style.css b/docs/blocks/content/style.css index 11e0b82..7cdfb8f 100644 --- a/docs/blocks/content/style.css +++ b/docs/blocks/content/style.css @@ -35,6 +35,10 @@ font-family: "Liberation Mono", "Nimbus Mono L", monospace; } +&SEL{$content} cite { + font-style: italic; +} + &SEL{$content} .footnotes ol { list-style-type: decimal; list-style-position: outside; diff --git a/docs/blocks/license/markup.html b/docs/blocks/license/markup.html index 735fe60..2775df5 100644 --- a/docs/blocks/license/markup.html +++ b/docs/blocks/license/markup.html @@ -2,7 +2,7 @@ # License ######################################################################>&
- {{.snippets.footer}} + {{snippets.footer}}
<# vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html diff --git a/docs/blocks/repository/markup.html b/docs/blocks/repository/markup.html index 277a984..5bb74db 100644 --- a/docs/blocks/repository/markup.html +++ b/docs/blocks/repository/markup.html @@ -6,7 +6,7 @@
  • issues
  • wiki
  • releases
  • -
  • top
  • +
  • top
  • <# vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html diff --git a/docs/blocks/repository/style.css b/docs/blocks/repository/style.css index 2bcae04..3e30fdc 100644 --- a/docs/blocks/repository/style.css +++ b/docs/blocks/repository/style.css @@ -13,6 +13,10 @@ font-weight: bold; } +&CHM{repository}{section}{internal} > a:focus { + color: &ColorPrimary; +} + &BEM{repository}{section}:first-child:before { content: "❲ "; color: &ColorSecondary; diff --git a/docs/blocks/toc/markup.html b/docs/blocks/toc/markup.html index e198ac3..c212d6d 100644 --- a/docs/blocks/toc/markup.html +++ b/docs/blocks/toc/markup.html @@ -2,7 +2,7 @@ # Toc ######################################################################>& <# diff --git a/docs/content/content.md b/docs/content/content.md index 4477e35..08d84d9 100644 --- a/docs/content/content.md +++ b/docs/content/content.md @@ -82,13 +82,13 @@ jqt -T -- text.yaml | yaml2json > snippets.json Then this converted file can be loaded by `jqt` in succesive calls: ```zsh -jqt -m snippets:snippets.json ... +jqt -j snippets:snippets.json ... ``` Template files (only!) can expand the snippets without never containing raw content: ```HTML -

    {{.snippets.title}}

    +

    {{snippets.title}}

    ``` This allows the absolute separation of structure and content, as it should be. diff --git a/docs/content/opt/D.txt b/docs/content/opt/D.txt index 2728d1b..d513532 100644 --- a/docs/content/opt/D.txt +++ b/docs/content/opt/D.txt @@ -1,5 +1,5 @@ --D NAME=VAL -: Defines the user macro *NAME* as equal to *VAL*. +-D NAME=STRING +: Defines the user macro *NAME* as equal to *STRING*. <# vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown #> diff --git a/docs/content/opt/L.txt b/docs/content/opt/L.txt index 24b1789..f973ae9 100644 --- a/docs/content/opt/L.txt +++ b/docs/content/opt/L.txt @@ -1,5 +1,5 @@ -L DIRECTORY -: Appends *DIRECTORY* to the end of the jq list of directories to be searched +: Appends *DIRECTORY* to the end of the _jq_ list of directories to be searched for included and imported modules. <# vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown diff --git a/docs/content/opt/S.txt b/docs/content/opt/S.txt index 8ca1b20..73b4e21 100644 --- a/docs/content/opt/S.txt +++ b/docs/content/opt/S.txt @@ -1,5 +1,5 @@ -S -: Stops template processing before the render stage (outputs the jq script). +: Stops template processing before the render stage (outputs the _jq_ script). <# vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown #> diff --git a/docs/content/opt/i.txt b/docs/content/opt/i.txt index 147ba53..2ed64c0 100644 --- a/docs/content/opt/i.txt +++ b/docs/content/opt/i.txt @@ -1,5 +1,5 @@ -i MODULE -: Includes the jq *MODULE* in the render stage. +: Includes the _jq_ *MODULE* in the render stage. <# vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown #> diff --git a/docs/content/opt/j.txt b/docs/content/opt/j.txt index 40da3e1..80f31a1 100644 --- a/docs/content/opt/j.txt +++ b/docs/content/opt/j.txt @@ -1,6 +1,6 @@ -j NAME:MODULE -: Imports the jq *MODULE* in the render stage and define helper function -named *NAME* if *MODULE* has the suffix `.json`. +: Imports the _jq_ *MODULE* in the render stage and define helper function +named *NAME* if *MODULE* is a data module and has the suffix `.json`. <# vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown #> diff --git a/docs/content/opt/p.txt b/docs/content/opt/p.txt index 76de331..f3c3a2e 100644 --- a/docs/content/opt/p.txt +++ b/docs/content/opt/p.txt @@ -1,5 +1,5 @@ -p -: Prints list of Pandoc accepted options. +: Prints information about Pandoc options. <# vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown #> diff --git a/share/sake.d/phase3.jq b/share/sake.d/phase3.jq index a8a96b1..8a5533f 100644 --- a/share/sake.d/phase3.jq +++ b/share/sake.d/phase3.jq @@ -24,7 +24,7 @@ def dependencies: def dataset: if .Datasets - then " " + ([.Datasets[] | basename | "-m\(.):\($Meta)/\(.).json"] | join(" ")) + then " " + ([.Datasets[] | basename | "-j\(.):\(.).json"] | join(" ")) else "" end ; @@ -52,11 +52,11 @@ def layout: # _site/jqt/index.html: content/index.md layouts/page.html content/macros.m content/LINKS.txt content/EXAMPLE.txt # $(info ==> $@) -# @$(JQT) -d $< -mpage:.meta/pages/index.json layouts/page.html | $(DETAILS) > $@ +# @$(JQT) -d $< -jpage:pages/index.json layouts/page.html | $(DETAILS) > $@ # ... # _site/jqt/blog/2017-04-13-hello.html: content/blog/2017-04-13-hello.md layouts/page.html # $(info ==> $@) -# @$(JQT) -d $< -mpage:.meta/pages/blog/2017-04-13-hello.json layouts/page.html | $(DETAILS) > $@ +# @$(JQT) -d $< -jpage:pages/blog/2017-04-13-hello.json layouts/page.html | $(DETAILS) > $@ def page_rule: .[] | "\($Root)/"+.URL+": " + .Source + dependencies,