From 8b11ae2e4fe3b910c0c547120cdfaabb9b2263ac Mon Sep 17 00:00:00 2001 From: Leif Madsen Date: Wed, 21 Apr 2010 19:18:35 +0000 Subject: Add ability to generate ASCII documentation from the TeX files. These changes add the ability to run 'make asterisk.txt' just like the existing 'make asterisk.pdf' commands to generate a text document from the TeX files we have in the doc/tex/ directory. I've also updated a few of the .tex files because they weren't properly escaping certain characters so they would show up as Unicode characters (like [U+021C]). Made changes to the configure scripts so it would detect the catdvi program which is required to convert the .dvi file generated by latex. I've also added a few lines to the build_tools/prep_tarball script so that the text documentation gets generated and added to future tarballs of Asterisk releases. (closes issue #17220) Reported by: lmadsen Patches: asterisk.txt.patch uploaded by lmadsen (license 10) asterisk.txt.patch-v4 uploaded by pabelanger (license 224) Tested by: lmadsen, pabelanger git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258351 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- doc/tex/Makefile | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'doc/tex/Makefile') diff --git a/doc/tex/Makefile b/doc/tex/Makefile index 57edd8d17..c36b3a847 100644 --- a/doc/tex/Makefile +++ b/doc/tex/Makefile @@ -20,7 +20,7 @@ ifeq ($(findstring fncychap.sty,$(shell find `$(KPATHSEA) --expand-braces='$${TE @echo "WARNING: The fncychap.sty document was not found" @echo "On Ubuntu, install the texlive-latex-extra package." @echo - @exit + @exit 1 endif endif @cp asterisk.tex asterisk.tex.orig @@ -44,3 +44,33 @@ html: @latex2html asterisk.tex @mv asterisk.tex.orig asterisk.tex +txt: asterisk.txt + +asterisk.txt: $(wildcard *.tex) +ifeq ($(findstring catdvi,$(CATDVI)),) + @echo "**********************************************" + @echo "** You must install the \"catdvi\" tool ***" + @echo "** to generate the Asterisk reference TXT. ***" + @echo "**********************************************" +else + @echo "**********************************************" + @echo "** The Asterisk reference TXT will now be ***" + @echo "** generated. When complete, it will be ***" + @echo "** located at asterisk.txt. ***" + @echo "**********************************************" +ifneq ($(findstring kpsewhich,$(KPATHSEA)),) +ifeq ($(findstring fncychap.sty,$(shell find `$(KPATHSEA) --expand-braces='$${TEXMF}'| tr -d \! | sed 's/:/ /g'` -name fncychap.sty -print)),) + @echo + @echo "WARNING: The fncychap.sty document was not found" + @echo "On Ubuntu, install the texlive-latex-extra package." + @echo + @exit 1 +endif +endif + @cp asterisk.tex asterisk.tex.orig + @sed -e 's/ASTERISKVERSION/$(ASTERISKVERSION)/' asterisk.tex > asterisk_local.tex + @mv asterisk_local.tex asterisk.tex + @latex asterisk.tex + -@$(CATDVI) -e 1 -U asterisk.dvi | sed -re "s/\[U\+2022\]/*/g" | sed -re "s/\[U\+02C6\]/^/g" | sed -re "s/([^^[:space:]])\s+/\1 /g" > asterisk.txt + @mv asterisk.tex.orig asterisk.tex +endif -- cgit v1.2.3