diff --git a/docs/Makefile b/docs/Makefile index fcdb04c..477c7af 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,4 +1,4 @@ -# jqt site documentation management +# jqt documentation management ######################################################################## # Prerequisites @@ -50,28 +50,28 @@ SHELL := /bin/bash ######################################################################## # Output directories -Meta := .yummy +Metadata := .yummy Destination := /tmp/jqt -# Directories for input files +# Input files directories Assets := ./assets Blocks := ./blocks Content := ./content +Data := ./data Styles := ./styles -Layouts := ./layouts -# Common sources for all targets +# Common dependencies for all targets Common := \ - $(Meta)/config.json \ - $(Meta)/snippets.json \ + $(Metadata)/config.json \ + $(Metadata)/snippets.json \ $(Blocks)/*/markup.html \ - $(Layouts)/default.html \ + $(Blocks)/main.html \ + $(Blocks)/filters.jq \ $(Content)/LINKS.txt \ - blocks/filters.jq \ - content/markup.m \ + $(Content)/macros.m \ # Files to "build" -Home := index +Home := index Pages := content data engine structure Files := README.md styles.css ManPage := ../jqt.1.gz @@ -81,19 +81,21 @@ Targets := \ $(ManPage) \ ######################################################################## -# Commands +# jqt command with options ######################################################################## -# The template engine (.site and .snippets defined in the jqt call) -JQT = jqt $(JQTFLAGS) +# The template engine (.site and .snippets are defined in the jqt call) + JQTFLAGS := \ -5 \ -I./ \ -iblocks/filters \ - -msite:$(Meta)/config.json \ - -msnippets:$(Meta)/snippets.json \ + -msite:$(Metadata)/config.json \ + -msnippets:$(Metadata)/snippets.json \ --toc-depth=4 \ +JQT = jqt $(JQTFLAGS) + ######################################################################## # Rules ######################################################################## @@ -101,29 +103,19 @@ JQTFLAGS := \ # Main all: $(Targets) -# Validation with vnu.jar -VNU := /usr/local/vnu/vnu.jar -valid: all - xmlwf $(Destination)/*.html - java -jar $(VNU) --errors-only --format gnu $(Destination)/*.html - -lint: all - xmlwf $(Destination)/*.html - java -jar $(VNU) --format text $(Destination)/*.html - # Directories -$(Meta) $(Destination): ; mkdir $@ >/dev/null 2>&1 || true +$(Metadata) $(Destination): ; mkdir $@ >/dev/null 2>&1 || true -# Meta files -$(Meta)/config.json: config.yaml \ -| $(Meta) +# Metadata files +$(Metadata)/config.json: config.yaml \ +| $(Metadata) yaml2json <$< >$@ -$(Meta)/snippets.json: $(Content)/snippets.yaml \ -| $(Meta) +$(Metadata)/snippets.json: $(Content)/snippets.yaml \ +| $(Metadata) jqt -T <$< | yaml2json > $@ -# Target files +# Documentation site to build $(Destination)/README.md: $(Assets)/README.md \ | $(Destination) $(info ==> $@) @@ -138,25 +130,25 @@ DETAILS := sed \ $(Destination)/index.html: $(Content)/home.md $(Common) \ | $(Destination) $(info ==> $@) - $(JQT) -d $< $(Layouts)/default.html > $@ + $(JQT) -d $< $(Blocks)/main.html > $@ $(foreach p,$(Pages),$(Destination)/$(p).html): $(Content)/FLOW.txt $(Content)/opt/*.txt $(Destination)/index.html $(Destination)/structure.html: $(Content)/EXAMPLE.txt define Target -$(Destination)/$(1).html: $(Content)/$(1).md $(Layouts)/$(2).html $(Common) \ +$(Destination)/$(1).html: $(Content)/$(1).md $(Blocks)/$(2).html $(Common) \ | $(Destination) $$(info ==> $$@) - $(JQT) -d $$< $(Layouts)/$(2).html | $(DETAILS) > $$@ + $(JQT) -d $$< $(Blocks)/$(2).html | $(DETAILS) > $$@ endef $(foreach p,$(Pages),$(eval $(call Target,$(p),page))) -$(Destination)/styles.css: $(Styles)/main.css $(Styles)/*.css $(Styles)/new/*.css $(Blocks)/*/*style.css +$(Destination)/styles.css: $(Styles)/*.css $(Styles)/new/*.css $(Blocks)/*/*style.css $(Styles)/macros.m $(info ==> $@) jqt -P CSS-min -I$(Styles) <$< >$@ -# Man page (to be build without callig `jqt`!) +# Man page (to be build without calling jqt!) GPP_MD := \ -U '<%' '>' '\B' '\B' '\W>' '<' '>' '$$' '' \ -M '<%' '>' '\B' '\B' '\W>' '<' '>' \ @@ -193,7 +185,7 @@ clean: rm -rf $(Destination)/* $(ManPage) clobber: - rm -rf $(Destination) $(Meta) + rm -rf $(Destination) $(Metadata) build: clean all @@ -208,4 +200,14 @@ help: | sed 's/:\+$$//' \ | pr --omit-pagination --indent=4 --width=80 --columns=4 +# Validation with vnu.jar +VNU := /usr/local/vnu/vnu.jar +valid: all + xmlwf $(Destination)/*.html + java -jar $(VNU) --errors-only --format gnu $(Destination)/*.html + +lint: all + xmlwf $(Destination)/*.html + java -jar $(VNU) --format text $(Destination)/*.html + # vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make diff --git a/docs/blocks/container/markup.html b/docs/blocks/container/markup.html new file mode 100644 index 0000000..abaefd3 --- /dev/null +++ b/docs/blocks/container/markup.html @@ -0,0 +1,12 @@ +<####################################################################### + # Document body + ######################################################################>& + + <%include blocks/header/markup.html>& + <%include blocks/body/markup.html>& + <%include blocks/footer/markup.html>& + <%partial analytics 'UA-82432866-1'>& + +<# +vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html +#>& diff --git a/docs/blocks/container/style.css b/docs/blocks/container/style.css new file mode 100644 index 0000000..7691980 --- /dev/null +++ b/docs/blocks/container/style.css @@ -0,0 +1,11 @@ +//////////////////////////////////////////////////////////////////////// +// Container +//////////////////////////////////////////////////////////////////////// + +@media screen { + body&SEL{#container} { + max-width: 800px; + } +} + +// vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=css diff --git a/docs/layouts/default.html b/docs/blocks/main.html similarity index 83% rename from docs/layouts/default.html rename to docs/blocks/main.html index ea65741..b538813 100644 --- a/docs/layouts/default.html +++ b/docs/blocks/main.html @@ -23,12 +23,7 @@ <# # Document body #> - - <%include blocks/header/markup.html>& - <%include blocks/body/markup.html>& - <%include blocks/footer/markup.html>& - <%partial analytics 'UA-82432866-1'>& - +<%include blocks/container/markup.html>& <# vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html diff --git a/docs/layouts/page.html b/docs/blocks/page.html similarity index 89% rename from docs/layouts/page.html rename to docs/blocks/page.html index d663e9a..87537e3 100644 --- a/docs/layouts/page.html +++ b/docs/blocks/page.html @@ -9,7 +9,7 @@ <# # Inherit default layout #>& -<%include layouts/default.html>& +<%include blocks/main.html>& <# vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html #>& diff --git a/docs/content/content.md b/docs/content/content.md index 4639bc5..36b3a91 100644 --- a/docs/content/content.md +++ b/docs/content/content.md @@ -5,7 +5,7 @@ description: jqt transforms MarkDown documents to HTML using Pandoc. keywords: jqt, markdown, pandoc, gpp, preprocessing, authoring content updated: "2016-08-28T10:27:09Z" --- -<%include content/markup.m>& +<%include content/macros.m>& <%include content/LINKS.txt>& # Authoring content diff --git a/docs/content/data.md b/docs/content/data.md index c3bea9e..e92efee 100644 --- a/docs/content/data.md +++ b/docs/content/data.md @@ -5,7 +5,7 @@ description: jqt combines one template with one MarkDown document and a data mod keywords: jqt, JSON, YAML, gpp, preprocessing, data model updated: "2016-08-28T10:27:09Z" --- -<%include content/markup.m>& +<%include content/macros.m>& <%include content/LINKS.txt>& # Data model diff --git a/docs/content/engine.md b/docs/content/engine.md index b2a9315..f137cb9 100644 --- a/docs/content/engine.md +++ b/docs/content/engine.md @@ -5,7 +5,7 @@ description: jqt orchestrates several shell utilities to transform MarkDown text keywords: jqt, jq, YAML, gpp, preprocessing, template engine updated: "2016-08-28T10:27:09Z" --- -<%include content/markup.m>& +<%include content/macros.m>& <%include content/LINKS.txt>& # Template engine diff --git a/docs/content/home.md b/docs/content/home.md index 14277ae..a04e108 100644 --- a/docs/content/home.md +++ b/docs/content/home.md @@ -5,7 +5,7 @@ description: Could be jq the basis for a web template engine? keywords: jqt, jq, template engine updated: "2016-08-28T10:27:09Z" --- -<%include content/markup.m>& +<%include content/macros.m>& <%include content/LINKS.txt>& # Welcome diff --git a/docs/content/markup.m b/docs/content/macros.m similarity index 100% rename from docs/content/markup.m rename to docs/content/macros.m diff --git a/docs/content/structure.md b/docs/content/structure.md index 1b93f08..1107934 100644 --- a/docs/content/structure.md +++ b/docs/content/structure.md @@ -1,11 +1,11 @@ --- layout: page title: Defining the page structure with jqt -description: Web pages structure is defined by the HTML markup. +description: Web pages structure is defined by the HTML macros. keywords: jqt, jq, gpp, preprocessing, template engine updated: "2016-08-28T10:27:09Z" --- -<%include content/markup.m>& +<%include content/macros.m>& <%include content/LINKS.txt>& # Page structure diff --git a/docs/data/.gitignore b/docs/data/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/docs/styles/bem.m b/docs/styles/macros.m similarity index 100% rename from docs/styles/bem.m rename to docs/styles/macros.m diff --git a/docs/styles/main.css b/docs/styles/main.css index af02231..d23280d 100644 --- a/docs/styles/main.css +++ b/docs/styles/main.css @@ -2,12 +2,19 @@ // main //////////////////////////////////////////////////////////////////////// -&include{bem.m} +&include{macros.m} &include{new/default.css} &include{milligram.css} //&include{media.css} +@media screen { + html { + background-color: &ColorInitial; + } +} + +&include{blocks/container/style.css} &include{blocks/header/style.css} &include{blocks/footer/style.css} &include{blocks/panel/style.css} @@ -18,13 +25,4 @@ &include{blocks/license/style.css} &include{blocks/repository/style.css} -@media screen { - html { - background-color: &ColorInitial; - } - body&SEL{#container} { - max-width: 800px; - } -} - // vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=css