summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig>2005-05-14 22:33:27 +0000
committerrillig <rillig>2005-05-14 22:33:27 +0000
commit130b7485d976740ad74e342de1c24be07b8bf42f (patch)
treedbca8302e7f2932899d77e1c9f4e43f81d7f6aaa
parent79f91df685b0b9b3135249ea36fa1efe84beae81 (diff)
downloadpkgsrc-130b7485d976740ad74e342de1c24be07b8bf42f.tar.gz
Added a "detab" target that replaces <tab> characters inside the
<programlisting> tag with an appropriate number of space characters. This is needed for TeX.
-rw-r--r--doc/guide/Makefile18
1 files changed, 17 insertions, 1 deletions
diff --git a/doc/guide/Makefile b/doc/guide/Makefile
index da5ae687baf..66ba2e6394e 100644
--- a/doc/guide/Makefile
+++ b/doc/guide/Makefile
@@ -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 @@ install-htdocs: build
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"