diff --git a/.gitignore b/.gitignore index 4673b08..a87cd8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # man pages jqt.1.gz +sake.1.gz # other *.swp diff --git a/Makefile b/Makefile index 4dc9dc7..24e11b6 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ SHELL := /bin/bash ######################################################################## # The only "productive" target... -ManPage := jqt.1.gz +ManPages := jqt.1.gz sake.1.gz # Dependencies from documentations files DOCS := docs @@ -110,7 +110,7 @@ install: all install --directory $(bindir) $(datadir) $(mandir)/man1 $(datadir)/$(PROJECT)/{sake.d,milligram} install --verbose --compare --mode 555 bin/* $(bindir) install --verbose --compare --mode 644 share/*.m $(datadir)/$(PROJECT) - install --verbose --compare --mode 644 $(ManPage) $(mandir)/man1 + install --verbose --compare --mode 644 $(ManPages) $(mandir)/man1 install --verbose --compare --mode 644 share/sake.d/*.* $(datadir)/$(PROJECT)/sake.d install --verbose --compare --mode 644 share/milligram/*.* $(datadir)/$(PROJECT)/milligram sed -i -e "s#DATADIR='.*'#DATADIR='$(datadir)'#" $(bindir)/jqt @@ -118,7 +118,8 @@ install: all uninstall: rm --verbose --force -- $(addprefix $(prefix)/,$(wildcard bin/*)) - rm --verbose --force -- $(mandir)/man1/$(ManPage) + rm --verbose --force -- $(addprefix $(mandir)/man1/,$(ManPages)) + rm --verbose --force -- $(mandir)/man1/$(ManPages) test -d $(datadir)/$(PROJECT) \ && rm --verbose --force --recursive $(datadir)/$(PROJECT) \ || true @@ -177,18 +178,18 @@ GPP_MD := gpp \ +ssss '\n```' '\n```' '' \ +ssss '\n~~~' '\n~~~' '' \ -# Man page: jqt(1) -$(ManPage): $(CONTENT)/jqt.1.text +# Man page: jqt(1) sake(1) +$(ManPages): %.1.gz : $(CONTENT)/%.1.text $(info ==> $@) @$(GPP_MD) -I$(DOCS) < $< \ | pandoc --standalone --from markdown --to man \ | gzip > $@ # Default target -all: $(ManPage) +all: $(ManPages) # Add prerequisites and recipes to common targets -clean:: ; @rm -f $(ManPage) +clean:: ; @rm -f $(ManPages) ######################################################################## # Tests diff --git a/bin/jqt b/bin/jqt index 0a98165..93a6f80 100755 --- a/bin/jqt +++ b/bin/jqt @@ -431,10 +431,10 @@ declare -A JSON_DATA=() YAML_DATA=() YAML_SNIPPETS=() declare -A JSON_DATA_DOT=() YAML_DATA_DOT=() # Global objects available in jq scripts: -# ._content -# ._highlight -# ._source -# ._toc +# ._content +# ._highlight +# ._source +# ._toc # ._front_matter # < stdin > stdout diff --git a/bin/sake b/bin/sake index 5dd64bc..2524326 100755 --- a/bin/sake +++ b/bin/sake @@ -81,7 +81,7 @@ case $1 in _sake configure "$@" ;; dag) - make -f Sakefile -Bdn build \ + make -f Sakefile -Bdn \ | sed -n \ -e "s/'//g" \ -e 's/\.$//' \ diff --git a/docs/Sakefile b/docs/Sakefile index 2bc228e..016ebfb 100644 --- a/docs/Sakefile +++ b/docs/Sakefile @@ -45,7 +45,7 @@ JQTFLAGS += -5 --toc-depth=4 depend: $(Meta)/phase3d.make cat $< | egrep -v '^#|^$$' | cut -c -72 - | sed 's/$$/.../' -# TODO: new, man page, SITE section on web, taxonomies (flags, series...) +# TODO: new, new-templates, man page, SITE section on web, taxonomies (flags, series...) # TODO: enhance `dag` command # TODO: -t -W -B ??? diff --git a/docs/content/jqt.1.text b/docs/content/jqt.1.text index 2b6ab22..b0c633a 100644 --- a/docs/content/jqt.1.text +++ b/docs/content/jqt.1.text @@ -66,7 +66,7 @@ Copyright © 2015 Joan Josep Ordinas Rosa. # SEE ALSO -**gpp(1)**, **jq(1)**, **pandoc(1)** +**gpp(1)**, **jq(1)**, **pandoc(1)**, **sake(1)** **jqt** home page: diff --git a/docs/content/sake.1.text b/docs/content/sake.1.text new file mode 100644 index 0000000..1d909b3 --- /dev/null +++ b/docs/content/sake.1.text @@ -0,0 +1,99 @@ +% SAKE(1) Version 0.1.0 | Build-automation utility for static web sites +% +% November 2018 + +# NAME + +**sake** – Build-automation utility for static web sites + +# SYNOPSIS + +| **sake** [command] [[options] [variable=definition] ...] + +# DESCRIPTION + +**sake** is a simple wrapper to _GNU Make_. + +# OPTIONS + +Inherit from _GNU Make_. + +# COMMANDS + +build +: Build the static web site. + +clean +: Remove generated static web site, + +clobber +: Remove all generated files and directories. + +configure +: Configure metadata used in the build process. + +dag +: Show directed acyclic graph of dependencies. + +h5.lint +: Verify generated HTML 5 files. + +h5.valid +: Validate generated HTML 5 files. + +help +: Show a short help message. + +list +: Show the list of commands available. + +new +: Create a new static web site. + +nuke +: Remove generated metadata. + +touch +: Touch the configuration file and build again the site. + +# FILES + +/usr/local/share/jqt/sake/sake.d +: Library of makefiles used by `sake`. + +/usr/local/share/jqt/milligram +: Minimal CSS framework. + +Sakefile +: Mandatory user makefile. + +# ENVIRONMENT + +JQTLIB (exported) +: Path to files used by `sake`. + +NCORES (imported) +: Number of cores in the build machine. + +# BUGS + +See GitHub issues: + +# AUTHOR + +**sake** was written by Joan Josep Ordinas Rosa . + +# COPYRIGHT + +Copyright © 2015 Joan Josep Ordinas Rosa. +**sake** is licensed under the MIT license (code) and the CC-BY-3.0 license (documents). + +# SEE ALSO + +**make(1)**, **jq(1)**, **jqt(1)** + +**jqt** home page: + + diff --git a/share/sake.d/main.make b/share/sake.d/main.make index 727d366..5c9afa1 100644 --- a/share/sake.d/main.make +++ b/share/sake.d/main.make @@ -139,6 +139,7 @@ build:: $(PagesHTML) @cp --verbose --recursive --update $(Assets)/* $(Root) \ | sed "s/^.*-> ./==> /;s/.$$//" date -Iseconds > $(Meta)/lastbuild + echo Done! Visit file://$(realpath $(Root))/index.html # Delete secondary files. clobber:: ; @rm -rf *~ *.bak *.log diff --git a/share/sake.d/phase3.make b/share/sake.d/phase3.make index f1e443d..f65be77 100644 --- a/share/sake.d/phase3.make +++ b/share/sake.d/phase3.make @@ -79,7 +79,7 @@ $(PagesHTML): $(Meta)/phase3.make \ | $$(dir $$@) # Content example for `$(Meta)/phase3.make`: - +######################################################################## # __phase_3 := 1 # # %.html: _site/%.html ; @@ -96,6 +96,11 @@ $(PagesHTML): $(Meta)/phase3.make \ # $(info ==> $@) # @$(JQT) -d $< -msnippets:.meta/snippets.json -mpage:.meta/pages/blog/index.json $(Layouts)/blog.html | $(DETAILS) > $@ +# Content example for `$(Meta)/phase3d.make`: +######################################################################## +#_site/content.html: blocks/body/_toc/markup.html blocks/content/markup.html blocks/footer/markup.html blocks/header/markup.html blocks/license/markup.html blocks/logo/markup.html blocks/menu-bar/markup.html blocks/repository/markup.html blocks/toc/markup.html layouts/default.html layouts/page-toc.html +#_site/data.html: blocks/body/_toc/markup.html blocks/content/markup.html blocks/footer/markup.html blocks/header/markup.html blocks/license/markup.html blocks/logo/markup.html blocks/menu-bar/markup.html blocks/repository/markup.html blocks/toc/markup.html layouts/default.html layouts/page-toc.html + endif # __phase_3 # vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make