Skip to content

Commit

Permalink
Defined sake manpage
Browse files Browse the repository at this point in the history
  • Loading branch information
fadado committed Dec 2, 2018
1 parent f23c1ca commit e80de34
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# man pages
jqt.1.gz
sake.1.gz
# other
*.swp
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -110,15 +110,16 @@ 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
sed -i -e "s#JQTLIB='.*'#JQTLIB='$(datadir)/jqt'#" $(bindir)/sake

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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions bin/jqt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/sake
Original file line number Diff line number Diff line change
Expand Up @@ -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/\.$//' \
Expand Down
2 changes: 1 addition & 1 deletion docs/Sakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ???

Expand Down
2 changes: 1 addition & 1 deletion docs/content/jqt.1.text
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://fadado.github.com/jqt/>

Expand Down
99 changes: 99 additions & 0 deletions docs/content/sake.1.text
Original file line number Diff line number Diff line change
@@ -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: <https://github.com/fadado/jqt/issues>

# AUTHOR

**sake** was written by Joan Josep Ordinas Rosa <[email protected]>.

# 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: <https://fadado.github.com/jqt/>

<!--
vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=markdown
-->
1 change: 1 addition & 0 deletions share/sake.d/main.make
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion share/sake.d/phase3.make
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ $(PagesHTML): $(Meta)/phase3.make \
| $$(dir $$@)

# Content example for `$(Meta)/phase3.make`:

########################################################################
# __phase_3 := 1
#
# %.html: _site/%.html ;
Expand All @@ -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

0 comments on commit e80de34

Please sign in to comment.