pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/doc/guide Added a "detab" target that replaces <tab> c...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/eb494311b37b
branches:  trunk
changeset: 493786:eb494311b37b
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat May 14 22:33:27 2005 +0000

description:
Added a "detab" target that replaces <tab> characters inside the
<programlisting> tag with an appropriate number of space characters.
This is needed for TeX.

diffstat:

 doc/guide/Makefile |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r be4c314e9766 -r eb494311b37b doc/guide/Makefile
--- a/doc/guide/Makefile        Sat May 14 22:32:59 2005 +0000
+++ b/doc/guide/Makefile        Sat May 14 22:33:27 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2005/05/07 22:40:25 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2005/05/14 22:33:27 rillig Exp $
 #
 
 DISTNAME=              htdocs-share-20050507
@@ -112,4 +112,20 @@
 do-lint:
        cd ${WRKSRC} ; ${MAKE} lint
 
+DETAB_PROGRAM= \
+       if (/<programlisting>/ .. /<\/programlisting>/) {               \
+               while (/(.*?)\t(.*)/s) {                                \
+                       my $$filler = " " x (8 - (length($$1) % 8));    \
+                       $$_ = "$$1$$filler$$2";                         \
+               }                                                       \
+       }
+
+# remove tabulators from the <programlisting> tags.
+# TeX does not like them.
+.PHONY: detab
+detab:
+       cd ${FILESDIR};                                                 \
+       perl -p -i ".detab.tmp" -e '${DETAB_PROGRAM}' *.xml;            \
+       ${RM} -f *.xml.detab.tmp
+
 .include "../../mk/bsd.pkg.mk"



Home | Main Index | Thread Index | Old Index