On Sun, May 14, 2017 at 03:53:02PM +0200, Harald Welte wrote:
I do like the "DRAFT" marking as it is not a
set of released manuals for
a given version of the software.
Having said that, if there's a real benefit from disabling draft
marking, please simply go for it.
Playing around for some minutes, I found these snippets:
(I did this of course before reading that I shouldn't bother with it)
Show "DRAFT" in the document header and drop the watermark:
-------------------------
diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc
index fad91fa..82721ff 100644
--- a/build/Makefile.asciidoc.inc
+++ b/build/Makefile.asciidoc.inc
@@ -16,15 +16,15 @@ ASCIIDOCSTYLE ?= $(BUILDDIR)/custom-dblatex.sty
cleanfiles += $(ASCIIDOCPDFS)
ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f
$(BUILDDIR)/docinfo-releaseinfo.conf
-DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes
+DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0
ifeq (,$(BUILD_RELEASE))
- DBLATEX_OPTS += -P draft.watermark=1
+ REVNUMBER := DRAFT $(GIT_VERSION)
else
- DBLATEX_OPTS += -P draft.watermark=0
+ REVNUMBER := $(GIT_VERSION)
endif
-A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)"
--dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a
revnumber="$(GIT_VERSION)" -a revdate="$(GIT_DATE)"
+A2X_OPTS := -L --asciidoc-opts="$(ASCIIDOC_OPTS)"
--dblatex-opts="$(DBLATEX_OPTS)" -a docinfo -a
revnumber="$(REVNUMBER)" -a revdate="$(GIT_DATE)"
all: $(ASCIIDOCPDFS)
-------------------------
I also found a bit of code to put a "DRAFT" on only the first page, but I find
it impossibly hard to figure out how to switch this snippet on and off
depending on the 'make BUILD_RELEASE=?' option. So if we don't need it to be
toggle-able, we can use it as-is. Otherwise, if someone has some dblatex magic
or a nifty trick to make these two lines conditional, that would give us the
conditional 'DRAFT' watermark on only the first page:
-------------------------
diff --git a/build/custom-dblatex.sty b/build/custom-dblatex.sty
index 66cf9a1..6d1b49d 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.8,0.8,0.8}
+\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{
-------------------------
That's enough dblatex for me now, asciidoc is so much easier to understand.
~N