From patchwork Sun May 14 18:05:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neels Hofmeyr X-Patchwork-Id: 762151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by ozlabs.org (Postfix) with ESMTP id 3wQs7q5t3Dz9sD5 for ; Mon, 15 May 2017 04:05:27 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 87E6C323A4; Sun, 14 May 2017 18:05:19 +0000 (UTC) Authentication-Results: lists.osmocom.org; dmarc=none header.from=sysmocom.de X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a01:4f8:191:444c::2:4; helo=mail.sysmocom.de; envelope-from=nhofmeyr@sysmocom.de; receiver=openbsc@lists.osmocom.org Authentication-Results: lists.osmocom.org; dmarc=none header.from=sysmocom.de Received: from mail.sysmocom.de (mail.sysmocom.de [IPv6:2a01:4f8:191:444c::2:4]) by lists.osmocom.org (Postfix) with ESMTP id 8657932364 for ; Sun, 14 May 2017 18:05:12 +0000 (UTC) Received: from mail.sysmocom.de (mail.sysmocom.de [144.76.43.93]) by mail.sysmocom.de (Postfix) with ESMTP id 068CB2CD30E; Sun, 14 May 2017 18:05:12 +0000 (UTC) Received: from my.box (unknown [37.120.56.53]) by mail.sysmocom.de (Postfix) with ESMTPSA id B72542CD30D; Sun, 14 May 2017 18:05:11 +0000 (UTC) Date: Sun, 14 May 2017 20:05:11 +0200 From: Neels Hofmeyr To: Harald Welte Subject: Re: osmo-gsm-manuals DRAFT Message-ID: <20170514180511.GB24995@my.box> References: <20170514130411.GA24995@my.box> <20170514135302.sli3bovlczr4k4pq@nataraja> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170514135302.sli3bovlczr4k4pq@nataraja> User-Agent: Mutt/1.5.23 (2014-03-12) X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openbsc@lists.osmocom.org Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" 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: ------------------------- ------------------------- That's enough dblatex for me now, asciidoc is so much easier to understand. ~N 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{