From 0a8f21b1e243d697c853c0fed4c4d0d0066465a2 Mon Sep 17 00:00:00 2001 From: Joan Josep Ordinas Rosa Date: Tue, 16 Aug 2016 10:25:32 +0200 Subject: [PATCH] Man page ok --- Makefile | 4 +++ bin/jqt | 79 ++++++++++-------------------------------- docs/Makefile | 14 ++++++-- docs/content/help.txt | 1 + docs/content/jqt.1.md | 75 +++++++++++++++++++++++++++++++++++++++ docs/content/opt/V.md | 2 +- jqt.1.gz | Bin 0 -> 1281 bytes 7 files changed, 112 insertions(+), 63 deletions(-) create mode 100644 docs/content/jqt.1.md create mode 100644 jqt.1.gz 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 0000000000000000000000000000000000000000..be670afe576b7d0e46378980b6d87bda081ecc78 GIT binary patch literal 1281 zcmV+c1^)UUiwFQ%&9YYj1FcuxQtLJlzSmRia0Q)%1MQ&~3}qUUl!PH9O#(9v$%SmM z9Z}mdlFU!1FVxrQlXWHA2_Xi~^z8}Ph8)ogI02DGB0)F>g}O)#9qz&becOlkq`pJuGYNL* zR`dO(UHw%pXo*Swdgo^I^(A(Q zD1#!!%y?|J#I-hVApxNwRN@gc@Lx!*&fph#TB5>I0i8+3v(2$E%Q^-Zg3d&qqj7Eu zl0<6<%(j_C#vCL;$2@nJ@|pTT_p>lgYuVpB9A3zHY7v|51)yLR;zT5k7fkCaSE zc+y)d=&-4gxrSWH0JRob3_g-=be<^8LR6p)j}dlD3mT$=U|yq^$`F$#-Cf82UvAo$ ztcwI{sk6|eG39}hKsXE*_KX9BYruzskT=yE60|QGH1{g6S4H#6eI6MyU@heeU+upM zf(|fz&WQ+=oLWy)6#dFpO`vUCF=oU+V>cZ7D;qU2?JkQHk8O%|laT>*2a{fBHk#bB zHqnCU=^$9`I)p5tm$pNMAfq=S5|I<3i3Sl1g~Gr{Rn>rxmo(N9bLIAGDbOtgz}TX?j{YXVnv)$1%%*Rxq?FS9n#tssCBu>#6!_Ymhq=# z`F2v)I-2ZEKPZ4t>$gl6(}5DXY0`dUyUMC1v#!u&9EWAp|lr z7PPvJLZoE6nY;!K$a>Gz0|QfLm1Ibg?76y@6irBxG{{BeZEKrh##3}ua~f9WS0vaC zG2(QMIeO0T_`||kaZgQ%EK5Y}9kznQENycq&N~_Rg?E^ zsv5N2SK5wUhyzzM-={JCUyDiuXOBE7(3ZdS@2UJZ+k1ltSwp^vF+?-l4pvFq&Xq62 zmv>W@v$3L!eASD_R82Af9t4Rzy?_r88I_J9TQ>*R%d;vOOX`5htINpd7gQ>_YO4zBJ}AQXx%v z8YWV6c5*Mv<*#wdMPe