From 590ef6294debf9b86a85090bab3d11e63c31e523 Mon Sep 17 00:00:00 2001 From: Hilary James Oliver Date: Thu, 23 Mar 2017 10:50:16 +1300 Subject: [PATCH] Tidied doc generation more. --- .gitignore | 17 +++++------ doc/Makefile | 1 - doc/src/cylc-user-guide/Makefile | 28 ++----------------- .../cylc-user-guide/scripts/make-commands.sh | 27 ++++++++++++------ doc/src/cylc-user-guide/scripts/make-html.sh | 22 +++------------ doc/src/cylc-user-guide/scripts/make-pdf.sh | 16 ++--------- doc/src/suite-design-guide/Makefile | 2 +- 7 files changed, 36 insertions(+), 77 deletions(-) diff --git a/.gitignore b/.gitignore index 13f9bccee76..087ae99151e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,16 +2,13 @@ # python bytecode *.pyc -# generated documentation -doc/commands/ -doc/categories/ -doc/cylc.txt -doc/commands.tex -doc/graphics/png-scaled/ -doc/html/ -doc/pdf/ -doc/index.html -doc/cylc-version.txt +# Generated documentation files. +# User Guide +doc/src/cylc-user-guide/pdf +doc/src/cylc-user-guide/html +doc/src/cylc-user-guide/commands.tex +doc/src/cylc-user-guide/cylc-version.txt +# Suite Design Guide *.aux *.out *.pdf diff --git a/doc/Makefile b/doc/Makefile index 9b6801267e6..b6e82045a64 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -50,4 +50,3 @@ clean: installclean: rm -r install - diff --git a/doc/src/cylc-user-guide/Makefile b/doc/src/cylc-user-guide/Makefile index b972cdf6614..77d1f944e5a 100644 --- a/doc/src/cylc-user-guide/Makefile +++ b/doc/src/cylc-user-guide/Makefile @@ -19,6 +19,7 @@ .PHONY: all pdf html html-multi html-single clean DEPS := $(shell ./scripts/get-deps.sh) +CYLC = ../../../bin/cylc all: $(DEPS) @@ -30,24 +31,7 @@ html-multi: html/multi/cug-html.html html-single: html/single/cug-html.html -cylc.txt: ../../../bin/cylc - $< --help > $@ - -cats = $(shell ../../../bin/cylc categories) -catx = $(cats:%=categories/%.txt) - -cmds = $(shell ../../../bin/cylc commands) -cmdx = $(cmds:%=commands/%.txt) - -$(cmdx): commands/%.txt: ../../../bin/cylc-% - if test ! -d commands; then mkdir -p commands/; fi - $(patsubst ../../../bin/cylc-%,../../../bin/cylc %,$<) --help > $@ - -$(catx): categories/%.txt: ../../../bin/cylc - if test ! -d categories; then mkdir -p categories/; fi - ../../../bin/cylc $(subst .txt,,$(subst categories/,,$@)) --help > $@ - -commands.tex: $(cmdx) $(catx) cylc.txt +commands.tex: $(CYLC)-* ./scripts/make-commands.sh html/multi/cug-html.html: commands.tex cug-html.tex cug.tex suiterc.tex siterc.tex gcylcrc.tex cug-html.cfg @@ -60,10 +44,4 @@ pdf/cug-pdf.pdf: commands.tex cug-pdf.tex cug.tex suiterc.tex siterc.tex gcylcrc - ./scripts/make-pdf.sh clean: - rm -r pdf \ - html \ - cylc.txt \ - commands \ - categories \ - commands.tex \ - cylc-version.txt + rm -rf pdf html commands.tex cylc-version.txt diff --git a/doc/src/cylc-user-guide/scripts/make-commands.sh b/doc/src/cylc-user-guide/scripts/make-commands.sh index 161699a6e3e..43776375403 100755 --- a/doc/src/cylc-user-guide/scripts/make-commands.sh +++ b/doc/src/cylc-user-guide/scripts/make-commands.sh @@ -16,19 +16,27 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -CYLC=../../bin/cylc +# Create cylc-version.txt and commands.tex for inclusion in LaTeX doc. + +CYLC=$(dirname $0)/../../../../bin/cylc + +$CYLC --version > cylc-version.txt cat > commands.tex <> commands.tex <> commands.tex <> commands.tex <. -set -e - -CYLC=$(dirname $0)/../../../../bin/cylc +# Make HTML Cylc User Guide (called from Makefile). -function usage { - echo "USAGE make-html.sh [multi|single]" -} - -if [[ $# != 1 ]]; then - usage - exit 1 -fi +set -e -TYPE=$1 -if [[ $TYPE != multi ]] && [[ $TYPE != single ]]; then - usage - exit 1 -fi +TYPE=$1 # "multi" or "single" DEST=html/$TYPE rm -rf $DEST; mkdir -p $DEST -$CYLC -v > cylc-version.txt - cp -r *.tex cug-html.cfg cylc-version.txt titlepic.sty $DEST + cd $DEST ls *.tex | xargs -n 1 perl -pi -e 's@graphics/png/orig@../../graphics/png/scaled@g' ls *.tex | xargs -n 1 perl -pi -e 's@\.\./examples/@../../../examples/@g' diff --git a/doc/src/cylc-user-guide/scripts/make-pdf.sh b/doc/src/cylc-user-guide/scripts/make-pdf.sh index 8876c07994c..4e323906447 100755 --- a/doc/src/cylc-user-guide/scripts/make-pdf.sh +++ b/doc/src/cylc-user-guide/scripts/make-pdf.sh @@ -16,25 +16,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set -e - -CYLC=$(dirname $0)/../../../../bin/cylc - -function usage { - echo "USAGE make.sh" -} +# Make PDF Cylc User Guide (called from Makefile). -if [[ $# != 0 ]]; then - usage - exit 1 -fi +set -e DEST=pdf rm -rf $DEST; mkdir -p $DEST -$CYLC -v > cylc-version.txt - cp -r *.tex cylc-version.txt titlepic.sty $DEST + cd $DEST ls *.tex | xargs -n 1 perl -pi -e 's@graphics/png/orig@../graphics/png/orig@g' ls *.tex | xargs -n 1 perl -pi -e 's@\.\./examples/@../../examples/@g' diff --git a/doc/src/suite-design-guide/Makefile b/doc/src/suite-design-guide/Makefile index 306c337f34f..2d49d3482e3 100644 --- a/doc/src/suite-design-guide/Makefile +++ b/doc/src/suite-design-guide/Makefile @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -.PHONY: all +.PHONY: all clean all: document.pdf