PDF version of the D manuals, take 2

BCS BCS at pathlink.com
Tue Dec 5 11:24:05 PST 2006


Walter Bright wrote:
> I've uploaded the source and makefile for the D documentation at:
> 
>     http://www.digitalmars.com/d/doc.zip
> 
> Ideally, I'd like to get this to the point where:
> 
>     make pdf
> 
> will generate all the documentation into one big pdf. I don't expect to 
> get there overnight, and I'm swamped with other tasks here, so if 
> someone wants to at least evaluate it for what needs to be done, that 
> will be very helpful.
> 
> P.S. The header, navigation buttons, footer, and left sidebar should be 
> removed from any pdf result.

Well first thing first, the markup in the *.d files should be converted 
to DDoc format [<b>.*</b> --> $(B .*) etc.]

I've started a makefile to do this (and a DOS to Linux conversion on the 
makefile and whatnot), so far it only does <B> and <I> now but it 
shouldn't be hard to extend some of the tags (<p> for instance) might 
not be so easy.

works on Linux

-put these file in some directory
-make html and tex subdirectories
-extract doc.zip to the html side
-make
-enjoy

<FILE>
SRC=tex/cpptod.d tex/ctod.d tex/dlinks.d tex/pretod.d tex/cppstrings.d \
	tex/cppcomplex.d tex/cppdbc.d tex/intro.d tex/overview.d \
	tex/lex.d tex/module.d tex/dnews.d tex/declaration.d tex/type.d\
	tex/property.d tex/attribute.d tex/pragma.d tex/expression.d \
	tex/statement.d tex/arrays.d tex/struct.d tex/class.d\
	tex/enum.d tex/function.d tex/operatoroverloading.d \
	tex/template.d tex/mixin.d tex/dbc.d tex/version.d \
	tex/errors.d tex/garbage.d tex/memory.d tex/float.d tex/iasm.d \
	tex/interface.d tex/portability.d tex/html.d tex/entity.d \
	tex/abi.d tex/windows.d tex/dll.d tex/htomodule.d tex/faq.d \
	tex/dstyle.d tex/wc.d tex/future.d tex/changelog.d \
	tex/glossary.d tex/acknowledgements.d tex/dcompiler.d \
	tex/builtin.d tex/interfaceToC.d tex/comparison.d \
	tex/rationale.d tex/ddoc.d tex/code_coverage.d \
	tex/exception-safe.d tex/rdmd.d tex/templates-revisited.d \
	tex/warnings.d tex/ascii-table.d tex/windbg.d tex/htod.d \
	tex/changelog1.d tex/download.d tex/regular-expression.d \
	tex/lazy-evaluation.d tex/lisp-java-d.d \
	tex/variadic-function-templates.d tex/howto-promote.d \
	tex/tuple.d

IMG=tex/dmlogo.gif tex/cpp1.gif tex/d002.ico tex/c1.gif tex/d3.gif


all : tex/makefile $(IMG) tex/style.css tex/doc.ddoc $(SRC)
	make -C tex
	make -C html

clean :
	rm tex/*

tex/makefile : html/win32.mak
	sed -e "s/copy/cp/" -e "s/del/rm -f/" -e "s/\.d\.html:/%.html : %.d /" 
html/win32.mak | head -n 196 > tex/makefile
	cp tex/makefile html/makefile

tex/c1.gif : html/c1.gif
	cp html/c1.gif tex/

tex/cpp1.gif : html/cpp1.gif
	cp html/cpp1.gif tex/

tex/d002.ico : html/d002.ico
	cp html/d002.ico tex/

tex/d3.gif : html/d3.gif
	cp html/d3.gif tex/

tex/dmlogo.gif : html/dmlogo.gif
	cp html/dmlogo.gif tex/

tex/style.css : html/style.css
	cp html/style.css tex/

tex/doc.ddoc : html/doc.ddoc more.ddoc
	cat html/doc.ddoc more.ddoc > tex/doc.ddoc

tex/%.d : filter.sed html/%.d
	sed -f filter.sed html/$*.d > tex/$*.d
</FILE>

<FILE name = "more.ddoc">
  MS=<h1>$0</h1>
  SC=<h2>$0 </h2>
  LS=<h3>$0</h3>
  TS=<h4>$0</h4>
</FILE>

<FILE name = "filter.sed">
  s/<b>/\$\(B /g
  s/</b>/\)/g
  s/<I>/\$\(I /g
  s/</I>/\)/g
</FILE>
Note there might be some errors in this last file as I forgot to copy it 
  over and rebuilt it from memory.



More information about the Digitalmars-d-announce mailing list