diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-05-14 19:50:23 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-06-12 22:15:30 +0000 |
commit | 3e646810f0bc1c6952a42a60499f33e32afa6081 (patch) | |
tree | 9629eadce67485102d2504a66401e9161f1084fd | |
parent | 3341330f3aef1e55ed57daedde68500d5f3ea127 (diff) |
all: show 'DRAFT' watermark on the first page
Unconditionally show a 'DRAFT' watermark only on the first page of each
document.
I would have liked to make this conditional based on the BUILD_RELEASE=*
variable, but could not figure out how to switch off a .sty code segment based
on command line parameters.
Since we only seem to render all manuals in DRAFT mode all the time, it seems
reasonable to include the DRAFT watermark always, requiring manual .sty editing
if anyone wanted to build a non-DRAFT version.
In the makefile, add an echo to say so in case of non-draft builds.
Change-Id: Ia71795481c2467aab11ab344517df74775b2a852
-rw-r--r-- | build/Makefile.asciidoc.inc | 9 | ||||
-rw-r--r-- | build/custom-dblatex.sty | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc index 82721ff..56a6ed9 100644 --- a/build/Makefile.asciidoc.inc +++ b/build/Makefile.asciidoc.inc @@ -29,7 +29,14 @@ A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)" --dblatex-opts="$(DBLATEX_OPTS all: $(ASCIIDOCPDFS) -$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc +.PHONY: hint_to_remove_draft_mode +hint_to_remove_draft_mode: + @test -n "$(BUILD_RELEASE)" && echo -e "\n\n\ + NOTE: TO REMOVE DRAFT MODE, YOU NEED TO EDIT build/custom-dblatex.sty\n\ + and remove three lines starting with '% \"DRAFT\" on first page'\n" \ + || true + +$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc hint_to_remove_draft_mode a2x $(A2X_OPTS) $< || asciidoc -v $(ASCIIDOC_OPTS) $< check: $(ASCIIDOC_CHECKS) diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty index a3822b5..41e7c70 100644 --- a/build/custom-dblatex.sty +++ b/build/custom-dblatex.sty @@ -19,6 +19,10 @@ \usepackage{alltt} \usepackage{upquote} +% "DRAFT" on first page +\definecolor{LtGrey}{rgb}{0.875,0.875,0.875} +\AddToShipoutPicture*{ \AtTextCenter{ \makebox(0,0)[c]{\resizebox{\textwidth}{!}{ \rotatebox{45}{\textsf{\textbf{\color{LtGrey}DRAFT}}}}} } } + \def\Company{sysmocom - s.f.m.c. GmbH} \def\DBKcover{ |