Thread overview
PDF version of the D manuals, take 2
Dec 05, 2006
Walter Bright
Dec 05, 2006
Sean Kelly
Dec 05, 2006
BCS
Dec 05, 2006
Walter Bright
Dec 05, 2006
BCS
Dec 05, 2006
Walter Bright
Dec 05, 2006
BCS
Dec 05, 2006
Walter Bright
Dec 06, 2006
BCS
December 05, 2006
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.
December 05, 2006
Walter Bright wrote:
> 
> P.S. The header, navigation buttons, footer, and left sidebar should be removed from any pdf result.

Actually, if possible I'd like to see the left sidebar converted to a "bookmarks" section.


Sean
December 05, 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.
December 05, 2006
BCS wrote:
> 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.

I've been gradually doing this, it just isn't complete yet.
December 05, 2006
Walter Bright wrote:
> BCS wrote:
>> 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.
> 
> I've been gradually doing this, it just isn't complete yet.

BTW what should be done with something like this:

<b>(</b> foo <b>)</b>

I would expect this doesn't work
$(B () foo $(B ))
December 05, 2006
BCS wrote:

> Walter Bright wrote:
> > BCS wrote:
> >>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.
> > 
> > I've been gradually doing this, it just isn't complete yet.
> 
> BTW what should be done with something like this:
> 
> <b>(</b> foo <b>)</b>
> 
> I would expect this doesn't work
> $(B () foo $(B ))

The the DDoc manual on macros:

"If stray, unnested parentheses are used, they can be replaced with the entity &#40; for ( and &#41; for )."

-- 

December 05, 2006
BCS wrote:
> BTW what should be done with something like this:
> 
> <b>(</b> foo <b>)</b>
> 
> I would expect this doesn't work
> $(B () foo $(B ))

$(B $(LPAREN)) $(B foo) $(B $(RPAREN))

Don't worry about them anyway, I have them fixed. The real problem is
coming up with a set of macros that will enable pdf generation.
December 05, 2006
Walter Bright wrote:
> BCS wrote:
>> BTW what should be done with something like this:
>>
>> <b>(</b> foo <b>)</b>
>>
>> I would expect this doesn't work
>> $(B () foo $(B ))
> 
> $(B $(LPAREN)) $(B foo) $(B $(RPAREN))
> 
> Don't worry about them anyway, I have them fixed. The real problem is
> coming up with a set of macros that will enable pdf generation.

My plan is after all the HTML is converted to DDoc, to build a set of DDoc -> TeX macros, Going from there to PDF is easy. If some other conversion sequence is chosen, it would just require some other set of macros.

Oddly enough, my current job has involved a bunch of automatic TeX generation. <g>
December 05, 2006
BCS wrote:
> My plan is after all the HTML is converted to DDoc, to build a set of DDoc -> TeX macros, Going from there to PDF is easy. If some other conversion sequence is chosen, it would just require some other set of macros.
> 
> Oddly enough, my current job has involved a bunch of automatic TeX generation. <g>

That sounds very fortuitous!
December 06, 2006
Walter Bright wrote:
> BCS wrote:
>> My plan is after all the HTML is converted to DDoc, to build a set of DDoc -> TeX macros, Going from there to PDF is easy. If some other conversion sequence is chosen, it would just require some other set of macros.
>>
>> Oddly enough, my current job has involved a bunch of automatic TeX generation. <g>
> 
> That sounds very fortuitous!

This is dead week so I won't be able to do anything for a week or so, but if I could get a few fully Ddoc'ed sources I would be willing to start building a set of TeX macros.