mirror of
https://github.com/flynx/photobook.git
synced 2025-10-29 02:10:08 +00:00
generalized doc generation...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b35f3810ca
commit
dce260a583
32
Makefile
32
Makefile
@ -7,11 +7,6 @@ TEX := lualatex
|
|||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
%.pdf: %.tex
|
|
||||||
$(TEX) $< > /dev/null
|
|
||||||
|
|
||||||
|
|
||||||
# Generate docs from latex package/class...
|
# Generate docs from latex package/class...
|
||||||
#
|
#
|
||||||
# - keep lines starting with \def\<module-name>@[A-Z]\+
|
# - keep lines starting with \def\<module-name>@[A-Z]\+
|
||||||
@ -27,18 +22,33 @@ TEX := lualatex
|
|||||||
# in both the repo and in installed form.
|
# in both the repo and in installed form.
|
||||||
# NOTE: this is evolving as need arises, when this gets too complicated
|
# NOTE: this is evolving as need arises, when this gets too complicated
|
||||||
# we'll split it out into it's own script.
|
# we'll split it out into it's own script.
|
||||||
#
|
texToDoc = \
|
||||||
# XXX need to do this without repeating the recipe...
|
@echo "texToDoc: $1 -> $2"; \
|
||||||
#%.tex: %.sty
|
cat $1 \
|
||||||
%.tex: %.cls
|
|
||||||
cat $< \
|
|
||||||
| egrep '(^%%|^\\\\def\\\\$*@[A-Z]+)' \
|
| egrep '(^%%|^\\\\def\\\\$*@[A-Z]+)' \
|
||||||
| sed 's/^\(\\\\def\\\\\)$*@/%%\\1/'\
|
| sed 's/^\(\\\\def\\\\\)$*@/%%\\1/'\
|
||||||
| sed 's/%%%%%% \(.*\)/%%\\\\subsubsection{\1}/' \
|
| sed 's/%%%%%% \(.*\)/%%\\\\subsubsection{\1}/' \
|
||||||
| sed 's/%%%%% \(.*\)/%%\\\\subsection{\1}/' \
|
| sed 's/%%%%% \(.*\)/%%\\\\subsection{\1}/' \
|
||||||
| sed 's/%%%% \(.*\)/%%\\\\section{\1}/' \
|
| sed 's/%%%% \(.*\)/%%\\\\section{\1}/' \
|
||||||
| sed 's/%%\s\+>>\s\+\(.*\)/%%\\\\begin{verbatim} \1 \\\\end{verbatim}/' \
|
| sed 's/%%\s\+>>\s\+\(.*\)/%%\\\\begin{verbatim} \1 \\\\end{verbatim}/' \
|
||||||
| cut -c 3- - > $@
|
| cut -c 3- - > $2
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
%.pdf: %.tex
|
||||||
|
$(TEX) $< > /dev/null
|
||||||
|
|
||||||
|
|
||||||
|
%.tex: %.sty
|
||||||
|
$(call texToDoc,$<,$@)
|
||||||
|
|
||||||
|
|
||||||
|
%.tex: %.cls
|
||||||
|
$(call texToDoc,$<,$@)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# XXX install... (see: ./tmp/Makefile)
|
# XXX install... (see: ./tmp/Makefile)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user