diff --git a/Makefile b/Makefile index e7b7c02..1c9a102 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ project := jqt prefix ?= /usr/local bindir ?= $(prefix)/bin datadir ?= $(prefix)/share +mandir ?= $(prefix)/share/man ######################################################################## # Prerequisites @@ -103,11 +104,14 @@ clobber: clean install: test -d $(bindir) || $(SUDO) mkdir --verbose --parents $(bindir) test -d $(datadir)/$(project) || $(SUDO) mkdir --verbose --parents $(datadir)/$(project) + test -d $(mandir)/man1 || $(SUDO) mkdir --verbose --parents $(mandir)/man1 $(SUDO) install --verbose --compare --mode 555 bin/* $(bindir) $(SUDO) install --verbose --compare --mode 644 share/* $(datadir)/$(project) + $(SUDO) install --verbose --compare --mode 644 jqt.1.gz $(mandir)/man1 uninstall: $(SUDO) rm --verbose --force -- $(addprefix $(prefix)/,$(wildcard bin/*)) + $(SUDO) rm --verbose --force -- $(mandir)/man1/jqt.1.gz test -d $(datadir)/$(project) \ && $(SUDO) rm --verbose --force --recursive $(datadir)/$(project) \ || true diff --git a/bin/jqt b/bin/jqt index 457c893..e3ac715 100755 --- a/bin/jqt +++ b/bin/jqt @@ -439,74 +439,31 @@ function help { cat <<'EOF' jqt - jq based web template engine [version 0.1.0] - Usage: jqt [options] < infile > result - jqt [options] infile > result - jqt [options] infile result - -Preprocessor options: - -D NAME=VAL - Define the user macro NAME as equal to VAL. - -I DIRECTORY - Append DIRECTORY to the end of the preprocessor list of - directories to be searched for include files. -Template options: - -L DIRECTORY - Append DIRECTORY to the end of the jq list of directories to be - searched for included and imported modules. - -i MODULE - Include the jq MODULE in the render stage. - -j MODULE:NAME - Import the jq MODULE in the render stage. -Document options: - -4, -5 - Set output HTML version (HTML4 / HTML5). - -d FILE - Read content document from FILE. + jqt [options] infile > result + jqt [options] infile result + +Some of the options include: + +Preprocessor options: Debugging options: + -D NAME=VAL -C + -I DIRECTORY -E +Template options: -H + -L DIRECTORY -P + -i MODULE -S + -j MODULE:NAME Information options: +Document options: -h, --help + -4, -5 -p + -d FILE -V, --version Metadata options: -M NAME:FILE - Add a FILE in YAML or JSON format to the input metadata at the top - level (NAME is ignored but must be present and unique). -m NAME:FILE - Add a FILE in YAML or JSON format to the input metadata as a value - of object NAME. -Debugging options: - -C - Stops processing before the render stage (outputs full JSON data - model). - -E - Stops template processing after the preprocessing stage (outputs the - expanded template). - -H - Stops MarkDown processing after generating HTML (outputs several - HTML fragments). - -P - Stops MarkDown processing after preprocessing stage (outputs the - expanded MarkDown). - -S - Stops template processing before the render stage (outputs the jq - script). -Information options: - -h, --help - Display this message. - -p - Print list of Pandoc accepted options. - -V - Display version information. + +See the manpage for full documentation and more options. EOF exit 0 } -# Not documented: -# -#?Document options: -#? -e -#? -r -#? -t -#?Metadata options: -#? -f NAME -#? -n NAME - function pandoc_options { cat < $@ +# Man page +$(MANPAGE): $(CONTENT)/jqt.1.md + $(MPMD) -I. -I$(CONTENT) $< \ + | pandoc --standalone --from markdown --to man \ + | gzip > $@ + ######################################################################## # Utilities ######################################################################## @@ -179,7 +189,7 @@ $(DESTINATION)/jqt.css: $(PRESENTATION)/jqt.css $(PRESENTATION)/github.css .PHONY: clean clobber build clean: - rm -rf $(DESTINATION)/* + rm -rf $(DESTINATION)/* $(MANPAGE) clobber: rm -rf $(DESTINATION) $(CACHE) diff --git a/docs/content/help.txt b/docs/content/help.txt index 3a88756..2e72042 100644 --- a/docs/content/help.txt +++ b/docs/content/help.txt @@ -39,3 +39,4 @@ Information options: <%include "opt/p.md"> <%include "opt/V.md"> +See the manpage for full documentation and more options. diff --git a/docs/content/jqt.1.md b/docs/content/jqt.1.md new file mode 100644 index 0000000..2a755da --- /dev/null +++ b/docs/content/jqt.1.md @@ -0,0 +1,75 @@ +% JQT(1) Version <%include ../VERSION> | jq based web template engine +% +% Aug 2016 + +# NAME + +**jqt** – jq based web template engine + +# SYNOPSIS + +| **jqt** \[options] < infile > result +| **jqt** \[options] infile > result +| **jqt** \[options] infile result +| **jqt** \[**-h**|**--help**|**-V**|**--version**] + +# DESCRIPTION + +**jqt** orchestrates several shell utilities to transform MarkDown text and +YAML or JSON data into a final HTML document. The transformation is driven by a template, +where HTML is mixed with **jq** snippets to implement the transformation logic. + +# OPTIONS + +<%include "opt/4.md"> +<%include "opt/C.md"> +<%include "opt/D.md"> +<%include "opt/E.md"> +<%include "opt/H.md"> +<%include "opt/I.md"> +<%include "opt/L.md"> +<%include "opt/M.md"> +<%include "opt/P.md"> +<%include "opt/S.md"> +<%include "opt/V.md"> +<%include "opt/d.md"> +<%include "opt/e.md"> +<%include "opt/f.md"> +<%include "opt/h.md"> +<%include "opt/i.md"> +<%include "opt/j.md"> +<%include "opt/m.md"> +<%include "opt/n.md"> +<%include "opt/p.md"> +<%include "opt/r.md"> +<%include "opt/t.md"> + +# FILES + +/usr/local/share/jqt/libjqt.m +: Initialization file for `gpp`. + +/usr/local/share/jqt/libjqt.jqt +: Initialization files for `jq`. + +/usr/local/share/jqt/\*.m +: Macro example files for `gpp`. + +# BUGS + +See GitHub issues: + +# AUTHOR + +**jqt** was written by Joan Josep Ordinas Rosa . + +# COPYRIGHT + +Copyright © 2015 Joan Josep Ordinas Rosa. +**jqt** is licensed under the MIT license (code) and the CC-BY-3.0 license (documents). + +# SEE ALSO + +**gpp(1)**, **jq(1)** + +**jqt** home page: diff --git a/docs/content/opt/V.md b/docs/content/opt/V.md index f062df0..d6a8046 100644 --- a/docs/content/opt/V.md +++ b/docs/content/opt/V.md @@ -1,4 +1,4 @@ --V +-V, --version : Display version information. <# diff --git a/jqt.1.gz b/jqt.1.gz new file mode 100644 index 0000000..be670af Binary files /dev/null and b/jqt.1.gz differ