From 40da1b4ca4a78a60e20cc5709368f95a7e72e55a Mon Sep 17 00:00:00 2001 From: Joan Josep Ordinas Rosa Date: Sun, 2 Dec 2018 13:03:20 +0100 Subject: [PATCH] Removed dot for page --- bin/jqt | 13 +++++++------ docs/Sakefile | 2 +- docs/blocks/content/markup.html | 2 +- docs/blocks/filters.jq | 12 +----------- docs/blocks/menu-bar/markup.html | 6 +++--- docs/blocks/repository/markup.html | 1 + docs/blocks/toc/markup.html | 2 +- docs/content/EXAMPLE.txt | 14 +++++++------- docs/content/opt/j.txt | 5 +++-- docs/content/structure.md | 4 ++-- docs/layouts/default.html | 18 +++++++++--------- share/sake.d/phase3.jq | 2 +- 12 files changed, 37 insertions(+), 44 deletions(-) diff --git a/bin/jqt b/bin/jqt index 9aa8169..f15e0a4 100755 --- a/bin/jqt +++ b/bin/jqt @@ -269,24 +269,25 @@ function convert echo '# vim:tabstop=2:syntax=jq' # jq modules - for module in ${!INCLUDES[@]}; do - echo "include \"${INCLUDES[$module]}\";" - done for module in ${!IMPORTS[@]}; do # remove .json suffix if present local basename="${IMPORTS[$module]}" basename=${basename%.json} echo "import \"${basename}\" as \$${module};" done - - # $jqt as a global reference to '.' - echo '. as $jqt |' + for module in ${!INCLUDES[@]}; do + echo "include \"${INCLUDES[$module]}\";" + done # define helper functions for JSON modules for module in ${!IMPORTS[@]}; do [[ ${IMPORTS[$module]} == *.json ]] || continue echo "def ${module}: \$${module}::${module}[0];" done + + # $jqt as a global reference to '.' + echo '. as $jqt |' + # convert template to script sed -e ' :RAW diff --git a/docs/Sakefile b/docs/Sakefile index 7fe368e..7965178 100644 --- a/docs/Sakefile +++ b/docs/Sakefile @@ -36,7 +36,7 @@ ifdef __build #JQTFLAGS += ... # Add some Pandoc options -JQTFLAGS += -5 --toc-depth=4 +JQTFLAGS += -5 --toc-depth=4 #-S ######################################################################## # experimental diff --git a/docs/blocks/content/markup.html b/docs/blocks/content/markup.html index 07605e4..059f0ae 100644 --- a/docs/blocks/content/markup.html +++ b/docs/blocks/content/markup.html @@ -2,7 +2,7 @@ # Content ######################################################################>&
- {{._content}} + {{$jqt._content}}
<# vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html diff --git a/docs/blocks/filters.jq b/docs/blocks/filters.jq index 15c6bed..21f8caf 100644 --- a/docs/blocks/filters.jq +++ b/docs/blocks/filters.jq @@ -2,23 +2,13 @@ # Extra filters for this site # -#import "pages-by-id" as $pages; -#import "phase1_site" as $site; - # Remove XML tags def striptags: # warning: algorithm too simplistic gsub("<[^>]*>"; "") ; -#def site: $site::site[0]; -#def pages: $pages::pages[0]; - -#def pages($section): -# [$pages::pages[0][] | select(.Section=="blog")] -#; - -def sections($pages): +def sections: # . as $pages map(.section) | unique diff --git a/docs/blocks/menu-bar/markup.html b/docs/blocks/menu-bar/markup.html index 5668e44..ad591d4 100644 --- a/docs/blocks/menu-bar/markup.html +++ b/docs/blocks/menu-bar/markup.html @@ -3,9 +3,9 @@ ######################################################################>& <# vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html diff --git a/docs/blocks/toc/markup.html b/docs/blocks/toc/markup.html index e14dc6c..e198ac3 100644 --- a/docs/blocks/toc/markup.html +++ b/docs/blocks/toc/markup.html @@ -3,7 +3,7 @@ ######################################################################>& <# vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html diff --git a/docs/content/EXAMPLE.txt b/docs/content/EXAMPLE.txt index 8be54e2..0d3f91a 100644 --- a/docs/content/EXAMPLE.txt +++ b/docs/content/EXAMPLE.txt @@ -3,21 +3,21 @@ #>& ``` - + - {{.page.title | gsub("<[^>]*>"; "")}} + {{page.title | gsub("<[^>]*>"; "")}} {# include files in preprocessing stage: #} <%include "head.html"> - + {# optional line: #} - + {# implicit loop for all authors: #} - {% .page.author | sort[] %} + {% page.author | sort[] %} -

{{.page.title}}

+

{{page.title}}

- {{.page._content}} + {{page._content}}
{# macro calls: #} <%partial analytics 'UA-82432866-1'> diff --git a/docs/content/opt/j.txt b/docs/content/opt/j.txt index 8b8b139..40da3e1 100644 --- a/docs/content/opt/j.txt +++ b/docs/content/opt/j.txt @@ -1,5 +1,6 @@ --j MODULE:NAME -: Imports the jq *MODULE* in the render stage. +-j NAME:MODULE +: Imports the jq *MODULE* in the render stage and define helper function +named *NAME* if *MODULE* has the suffix `.json`. <# vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown #> diff --git a/docs/content/structure.md b/docs/content/structure.md index 8f7516a..e447941 100644 --- a/docs/content/structure.md +++ b/docs/content/structure.md @@ -109,7 +109,7 @@ you can put this conditional macro call to define a default title block: ``` <%ifndef HEAD_TITLE> - {{.page.title}} {# default block #} + {{page.title}} {# default block #} <%else><%call HEAD_TITLE><%endif> ``` @@ -118,7 +118,7 @@ before include the base template: ``` <%define HEAD_TITLE - {{.page.title}} – {{.site.title}} + {{page.title}} – {{site.title}} > <%include default.html> ``` diff --git a/docs/layouts/default.html b/docs/layouts/default.html index cdcbf0e..60a5e6f 100644 --- a/docs/layouts/default.html +++ b/docs/layouts/default.html @@ -1,25 +1,25 @@ <# Top-level page markup #>& - + <# # Meta elements #> <# Document title and related metadata #> - jqt · {{.page.title}} - - - + jqt · {{page.title}} + + + <# More metadata #> - + <# Presentation #> - + - - {{._highlight}} + + {{$jqt._highlight}} <# # Document body diff --git a/share/sake.d/phase3.jq b/share/sake.d/phase3.jq index 740b833..a8a96b1 100644 --- a/share/sake.d/phase3.jq +++ b/share/sake.d/phase3.jq @@ -35,7 +35,7 @@ def flags: ; def page: - " -mpage:\($Meta)/pages/\(.Id).json" + " -jpage:pages/\(.Id).json" ; # %.html: _site/%.html ;