# HG changeset patch # User Jari-Matti M?kel? # Date 1193859753 -7200 # Node ID e562d455cbbe283c05316b0f09822a94bac81347 # Parent 7f7b2232a9ebfbe1455dfe165ec3a7370c3173d8 Fixed latex regressions, added html file lists. diff -r 7f7b2232a9eb -r e562d455cbbe trunk/src/docgen/config/default.cfg --- a/trunk/src/docgen/config/default.cfg Wed Oct 31 20:15:16 2007 +0200 +++ b/trunk/src/docgen/config/default.cfg Wed Oct 31 21:42:33 2007 +0200 @@ -22,7 +22,7 @@ (templates (title "Test project") (versionString 1.0) - (copyright "(C) Me!") + (copyright "Crashtest dummy") (paperSize a4paper) (shortFileNames false) (templateStyle default) diff -r 7f7b2232a9eb -r e562d455cbbe trunk/src/docgen/document/htmlgenerator.d --- a/trunk/src/docgen/document/htmlgenerator.d Wed Oct 31 20:15:16 2007 +0200 +++ b/trunk/src/docgen/document/htmlgenerator.d Wed Oct 31 21:42:33 2007 +0200 @@ -98,6 +98,17 @@ void generateListings() { writeSimpleFile(docFileNames[4], { docWriter.generateListingSection(modules); + + char[][] contents; + + foreach(mod; modules) { + auto FQN = mod.moduleFQN; + auto dstFname = replace(mod.moduleFQN.dup, '.', '_') ~ ".html"; + contents ~= `` ~ FQN ~ ""; + } + + docWriter.addList(contents, false); + docWriter.generateCustomPage("pagetemplate2", docgen_version); }); diff -r 7f7b2232a9eb -r e562d455cbbe trunk/src/docgen/document/latexgenerator.d --- a/trunk/src/docgen/document/latexgenerator.d Wed Oct 31 20:15:16 2007 +0200 +++ b/trunk/src/docgen/document/latexgenerator.d Wed Oct 31 21:42:33 2007 +0200 @@ -20,7 +20,6 @@ auto depGraphFile = "depgraph.dot"; auto listingFile = "files.tex"; auto modulesFile = "modules.tex"; - auto langDefFile = "lstlang0.sty"; public: @@ -45,7 +44,6 @@ generateClasses(); generateModules(); generateDependencies(); - generateLangDef(); generateMakeFile(docFileName, "pdf"); } @@ -71,13 +69,6 @@ } /** - * Generates D language definition file. - */ - void generateLangDef() { - writeSimpleFile(langDefFile, { docWriter.generateCustomPage("langdef"); }); - } - - /** * Generates documentation for classes. */ void generateClasses() { diff -r 7f7b2232a9eb -r e562d455cbbe trunk/src/docgen/misc/textutils.d --- a/trunk/src/docgen/misc/textutils.d Wed Oct 31 20:15:16 2007 +0200 +++ b/trunk/src/docgen/misc/textutils.d Wed Oct 31 21:42:33 2007 +0200 @@ -9,6 +9,7 @@ { char[] result; result.length = text.length; + result.length = 0; foreach(c; text) switch(c) { diff -r 7f7b2232a9eb -r e562d455cbbe trunk/src/docgen/page/htmlwriter.d --- a/trunk/src/docgen/page/htmlwriter.d Wed Oct 31 20:15:16 2007 +0200 +++ b/trunk/src/docgen/page/htmlwriter.d Wed Oct 31 21:42:33 2007 +0200 @@ -10,8 +10,6 @@ import tango.text.convert.Sprint; import tango.io.FilePath; -// TODO: this is mostly broken now - /** * Writes a HTML document skeleton. */ @@ -76,8 +74,8 @@ auto content = super.getTemplate(name); foreach(pageName; [ - "firstpage"[], "toc"[], "classes"[], "modules"[], "listings"[], - "dependencies"[], "lastpage"[] ]) { + "firstpage"[], "toc"[], "classes"[], "modules"[], "listing"[], + "listings"[], "dependencies"[], "lastpage"[] ]) { if (name == pageName) { auto sprint = new Sprint!(char)(5120); char[] title = factory.options.templates.title ~ " "; @@ -86,6 +84,7 @@ case "toc": title ~= "TOC"; break; case "classes": title ~= "Class index"; break; case "modules": title ~= "Module index"; break; + case "listing": title ~= "File contents"; break; case "listings": title ~= "File index"; break; case "dependencies": title ~="Dependencies"; break; } @@ -103,11 +102,17 @@ switch(item) { case "(": print(ordered ? "
    " : "
" : ""); continue; - default: print("
  • ")(xml_escape(item))("
  • "); + default: print("
  • ")(item)("
  • "); } } } + override void addListing(char[] moduleName, char[] contents, bool inline) { + print.format(getTemplate("listing"), moduleName, contents); + + footer(); + } + protected: /** diff -r 7f7b2232a9eb -r e562d455cbbe trunk/src/docgen/templates/default/html/listing.tpl --- a/trunk/src/docgen/templates/default/html/listing.tpl Wed Oct 31 20:15:16 2007 +0200 +++ b/trunk/src/docgen/templates/default/html/listing.tpl Wed Oct 31 21:42:33 2007 +0200 @@ -1,1 +1,2 @@ -
    {}
    +

    {0} Contents

    +
    {1}
    diff -r 7f7b2232a9eb -r e562d455cbbe trunk/src/docgen/templates/default/latex/langdef.tpl --- a/trunk/src/docgen/templates/default/latex/langdef.tpl Wed Oct 31 20:15:16 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -%% -%% D definition (c) 2007 Jari-Matti Mäkelä -%% -\lst@definelanguage{D}% - {morekeywords={abstract,alias,align,asm,assert,auto,body,bool,break,% - byte,case,cast,catch,cdouble,cent,cfloat,char,class,const,continue,% - creal,dchar,debug,default,delegate,delete,deprecated,do,double,% - else,enum,export,extern,false,final,finally,float,for,foreach,% - foreach_reverse,function,goto,idouble,if,ifloat,import,in,inout,% - int,interface,invariant,ireal,is,lazy,long,macro,mixin,module,new,% - null,out,override,package,pragma,private,protected,public,real,ref,% - return,scope,short,static,struct,super,switch,synchronized,template,% - this,throw,true,try,typedef,typeid,typeof,ubyte,ucent,uint,ulong,% - union,unittest,ushort,version,void,volatile,wchar,while,with},% - sensitive,% - - morecomment=[s]{/*}{*/},% - morecomment=[n]{/+}{+/},% - morecomment=[l]//,% - morestring=[b]",% - morestring=[b]`% - }[keywords,comments,strings]% diff -r 7f7b2232a9eb -r e562d455cbbe trunk/src/docgen/templates/default/latex/static/lstlang0.sty --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/src/docgen/templates/default/latex/static/lstlang0.sty Wed Oct 31 21:42:33 2007 +0200 @@ -0,0 +1,22 @@ +%% +%% D definition (c) 2007 Jari-Matti Mäkelä +%% +\lst@definelanguage{D}% + {morekeywords={abstract,alias,align,asm,assert,auto,body,bool,break,% + byte,case,cast,catch,cdouble,cent,cfloat,char,class,const,continue,% + creal,dchar,debug,default,delegate,delete,deprecated,do,double,% + else,enum,export,extern,false,final,finally,float,for,foreach,% + foreach_reverse,function,goto,idouble,if,ifloat,import,in,inout,% + int,interface,invariant,ireal,is,lazy,long,macro,mixin,module,new,% + null,out,override,package,pragma,private,protected,public,real,ref,% + return,scope,short,static,struct,super,switch,synchronized,template,% + this,throw,true,try,typedef,typeid,typeof,ubyte,ucent,uint,ulong,% + union,unittest,ushort,version,void,volatile,wchar,while,with},% + sensitive,% + + morecomment=[s]{/*}{*/},% + morecomment=[n]{/+}{+/},% + morecomment=[l]//,% + morestring=[b]",% + morestring=[b]`% + }[keywords,comments,strings]%