Skip to content

Commit

Permalink
Update doc build to use version number where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Mar 4, 2011
1 parent dc33879 commit aa8dd04
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 17 deletions.
3 changes: 2 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
include Makefile.inc

DIRS = en
VERSION=$(shell grep version.number= ../version.properties | cut -d= -f 2)

.PHONY: all clean

all : $(DIRS)
$(MAKE) -C $<
$(MAKE) VERSION=$(VERSION) -C $<

clean : $(DIRS)
$(MAKE) -C $< clean
7 changes: 5 additions & 2 deletions docs/en/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ all : dist man html figures
dist :
mkdir -p $(DIST)
man :
$(MAKE) -C manpages
$(MAKE) VERSION=$(VERSION) -C manpages

$(DIST)/html : dist
mkdir -p $(DIST)/html

html : $(DIST)/html
$(ECHO) Generating HTML book
@ $(ECHO) Generating HTML book version $(VERSION)
# set version
@sed "s/@VERSION@/$(VERSION)/" title.txt.template > title.txt
$(PANDOC) --number-sections --toc -s title.txt 0[0-9]-*/*.md --css=$(CSS) --template=templates/html.template --include-before=templates/before.html --include-after=templates/after.html -o $(DIST)/html/RunDeck-Guide.html
-rm title.txt
cp $(CSS) $(DIST)/html

$(DIST)/html/figures : dist
Expand Down
6 changes: 4 additions & 2 deletions docs/en/manpages/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ all: subdirs htmlindex
subdirs: $(DIRS)

$(DIRS) :
$(MAKE) -C $@
$(MAKE) VERSION=$(VERSION) -C $@

clean : $(DIRS)
$(MAKE) -C $< clean
Expand All @@ -32,6 +32,8 @@ htmlindex: subdirs
f=$$(basename $$i); \
echo "* [$${f%.5.md}]($${f%.5.md}.html) " >> man5.index.md; \
done;
# set version in index file
sed "s/@VERSION@/$(VERSION)/" index.md.template > index.md
#concat md files and generate index.html
$(PANDOC) -s index.md man1.index.md man5.index.md --css=$(CSS) --template=$(TEMPLATES)/html.template --include-before=$(TEMPLATES)/before.html --include-after=$(TEMPLATES)/after.html -o $(DIST)/html/index.html;
-rm -f man1.index.md man5.index.md
-rm -f man1.index.md man5.index.md index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Rundeck Documentation (1.1)
% Rundeck Documentation (@VERSION@)
% Greg Schueler
% 1/18/2011

Expand Down
6 changes: 3 additions & 3 deletions docs/en/manpages/man1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rundeck-guide.1:
gzip < $< > $@

%.1:
pandoc -s -w man $@.md -o $@
sed "s/@VERSION@/$(VERSION)/" $@.md | pandoc -s -w man -o $@

PAGES = dispatch.1 rd-jobs.1 rd-options.1 rd-setup.1 rd-queue.1 run.1

Expand All @@ -26,12 +26,12 @@ publish : roff html
roff :
$(ECHO) Generating system man pages
mkdir -p $(DIST)/man/man1
-for f in $(PAGES); do ( $(PANDOC) -s -w man $$f.md -o $(DIST)/man/man1/$$f; ); done
-for f in $(PAGES); do ( sed "s/@VERSION@/$(VERSION)/" $$f.md | $(PANDOC) -s -w man -o $(DIST)/man/man1/$$f; ); done

html :
$(ECHO) Generating html for system man pages
mkdir -p $(DIST)/html
-for f in $(PAGES); do ( $(PANDOC) -s --css=$(CSS) --template=$(TEMPLATES)/html.template --include-before=$(TEMPLATES)/before.html --include-after=$(TEMPLATES)/after.html $$f.md -o $(DIST)/html/$${f%.1}.html; ); done
-for f in $(PAGES); do ( sed "s/@VERSION@/$(VERSION)/" $$f.md | $(PANDOC) -s --css=$(CSS) --template=$(TEMPLATES)/html.template --include-before=$(TEMPLATES)/before.html --include-after=$(TEMPLATES)/after.html -o $(DIST)/html/$${f%.1}.html); done

clean :
rm -f *.1 *.1.gz
Expand Down
2 changes: 1 addition & 1 deletion docs/en/manpages/man1/dispatch.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% DISPATCH(1) RunDeck User Manuals | Version 1.1
% DISPATCH(1) RunDeck User Manuals | Version @VERSION@
% Alex Honor
% November 20, 2010

Expand Down
2 changes: 1 addition & 1 deletion docs/en/manpages/man1/rd-jobs.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% RD-JOBS(1) RunDeck User Manuals | Version 1.1
% RD-JOBS(1) RunDeck User Manuals | Version @VERSION@
% Greg Schueler; Alex Honor
% November 20, 2010

Expand Down
2 changes: 1 addition & 1 deletion docs/en/manpages/man1/rd-options.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% RD-OPTIONS(1) RunDeck User Manuals | Version 1.1
% RD-OPTIONS(1) RunDeck User Manuals | Version @VERSION@
% Greg Schueler; Alex Honor
% November 20, 2010

Expand Down
2 changes: 1 addition & 1 deletion docs/en/manpages/man1/rd-queue.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% RD-QUEUE(1) RunDeck User Manuals | Version 1.1
% RD-QUEUE(1) RunDeck User Manuals | Version @VERSION@
% Greg Schueler; Alex Honor
% November 20, 2010

Expand Down
2 changes: 1 addition & 1 deletion docs/en/manpages/man1/rd-setup.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% RD-SETUP(1) RunDeck User Manuals | Version 1.1
% RD-SETUP(1) RunDeck User Manuals | Version @VERSION@
% Alex Honor
% November 20, 2010

Expand Down
2 changes: 1 addition & 1 deletion docs/en/manpages/man1/run.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% RUN(1) RunDeck User Manuals | Version 1.1
% RUN(1) RunDeck User Manuals | Version @VERSION@
% Alex Honor
% November 20, 2010

Expand Down
2 changes: 1 addition & 1 deletion docs/en/manpages/man5/job-v20.5.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% JOB-V20(5) RunDeck User Manuals | Version 1.0
% JOB-V20(5) RunDeck User Manuals | Version 2.0
% Alex Honor
% November 20, 2010

Expand Down
2 changes: 1 addition & 1 deletion docs/en/title.txt → docs/en/title.txt.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
% RUNDECK(1) RunDeck User Manuals | Version 1.1
% RunDeck User Manual | Version @VERSION@
% Alex Honor; Greg Schueler
% November 20, 2010

0 comments on commit aa8dd04

Please sign in to comment.