]> granicus.if.org Git - docbook-dsssl/commitdiff
Added target for making plain-text output.
authorMichael Smith <xmldoc@users.sourceforge.net>
Sun, 16 Oct 2005 09:36:26 +0000 (09:36 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Sun, 16 Oct 2005 09:36:26 +0000 (09:36 +0000)
contrib/tools/make/Makefile.example

index 233672b55a6e982e146a2de7d6d4be6872016c15..fda586da96b5aa47054217fc8f84e787f1cd73e6 100644 (file)
 
 TMPNUM := $(shell echo $$$$)
 
+PDF_MAKER = fop
+
+TXT_MAKER = links
+#TXT_MAKER = lynx
+
+TXT_MAKER_FLAGS = -dump
+
 XSLTPROC = xsltproc
 XSLTPROC_FLAGS = --xinclude
 
-PDF_MAKER = fop
-
 DBLATEX = dblatex
 DBLATEX_FLAGS = 
 
@@ -68,6 +73,7 @@ DOCBOOK_FILE_EXTENSION = .xml
 SOURCE_FILES_DBK = $(wildcard *$(DOCBOOK_FILE_EXTENSION))
 
 FILES_FO   = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).fo)
+FILES_TXT  = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).txt)
 FILES_PDF  = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).pdf)
 FILES_LOG  = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).log)
 FILES_OUT  = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).out)
@@ -78,7 +84,7 @@ FILES_DMAN = $(foreach base,$(basename $(SOURCE_FILES_DBK)),.$(base).man)
 FILES_HTML = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).html)
 FILES_INFO = $(foreach base,$(basename $(SOURCE_FILES_DBK)),$(base).info)
 
-all: man html pdf
+all: man html txt pdf
 
 debug:
        echo $(TMPNUM)
@@ -115,6 +121,12 @@ info: $(FILES_INFO)
 %.html: %.xml
        $(XSLTPROC) $(XSLTPROC_FLAGS) $(DOCBOOK_XSL_HTML) $< > $@
 
+%.txt: %.html
+       $(TXT_MAKER) $(TXT_MAKER_FLAGS) ./$< \
+         | sed "s/^\(\s\+[0-9]\+\. \)file:\/\/.\+$$/\\1(local)/g" \
+         | egrep -v '^ file:///.+$$' \
+         > $@
+
 %.fo: %.xml
        $(XSLTPROC) $(XSLTPROC_FLAGS) $(FO_PARAMS) $(DOCBOOK_XSL_FO) $< > $@