# HG changeset patch # User Jari-Matti M?kel? # Date 1193839391 -7200 # Node ID 32f4c3cb6a415f254868877975c491a2c24ed08d # Parent db7e27b5c180e6150681faf1d6f8755a6c3a9e8e Support for static content. diff -r db7e27b5c180 -r 32f4c3cb6a41 trunk/src/docgen/document/generator.d --- a/trunk/src/docgen/document/generator.d Wed Oct 31 15:17:20 2007 +0200 +++ b/trunk/src/docgen/document/generator.d Wed Oct 31 16:03:11 2007 +0200 @@ -12,7 +12,10 @@ import docgen.config.configurator; import tango.io.stream.FileStream; import tango.io.FilePath; +import tango.io.FileScan; debug import tango.io.Stdout; +import tango.io.Stdout; + alias void delegate(ref Module[], ref Edge[], ref Vertex[char[]]) ParserDg; @@ -47,6 +50,9 @@ // create output dir (new FilePath(options.outputDir ~ "/" ~ genDir)).create(); + + // copy static files + copyStaticContent(); } DocGeneratorOptions *options() { @@ -71,6 +77,18 @@ return options.outputDir ~ "/" ~ genDir ~ "/" ~ file; } + void copyStaticContent() { + auto scan = new FileScan(); + scan(templateDir~options.templates.templateStyle~"/"~formatDirs[docFormat]~"/static/"); + + foreach(filePath; scan.files) { + (new FilePath(outPath(filePath.file))).copy(filePath.toUtf8()); + } + + Stdout(); + Stdout(scan.files.length)(" static files copied.\n"); + } + FileOutput outputFile(char[] fname) { return new FileOutput(outPath(fname)); } diff -r db7e27b5c180 -r 32f4c3cb6a41 trunk/src/docgen/page/writer.d --- a/trunk/src/docgen/page/writer.d Wed Oct 31 15:17:20 2007 +0200 +++ b/trunk/src/docgen/page/writer.d Wed Oct 31 16:03:11 2007 +0200 @@ -19,6 +19,8 @@ const templateDir = "docgen/templates/"; +const formatDirs = [ "latex"[], "xml"[], "html"[], "plaintext"[] ]; + /** * Writes the logical subcomponents of a document, * e.g. sections, embedded graphics, lists diff -r db7e27b5c180 -r 32f4c3cb6a41 trunk/src/docgen/templates/default/html/pagetemplate.tpl --- a/trunk/src/docgen/templates/default/html/pagetemplate.tpl Wed Oct 31 15:17:20 2007 +0200 +++ b/trunk/src/docgen/templates/default/html/pagetemplate.tpl Wed Oct 31 16:03:11 2007 +0200 @@ -7,6 +7,15 @@ +
+ +

{1}

{2}
diff -r db7e27b5c180 -r 32f4c3cb6a41 trunk/src/docgen/templates/default/html/static/tab_b.gif Binary file trunk/src/docgen/templates/default/html/static/tab_b.gif has changed diff -r db7e27b5c180 -r 32f4c3cb6a41 trunk/src/docgen/templates/default/html/static/tab_l.gif Binary file trunk/src/docgen/templates/default/html/static/tab_l.gif has changed diff -r db7e27b5c180 -r 32f4c3cb6a41 trunk/src/docgen/templates/default/html/static/tab_r.gif Binary file trunk/src/docgen/templates/default/html/static/tab_r.gif has changed diff -r db7e27b5c180 -r 32f4c3cb6a41 trunk/src/docgen/templates/default/html/static/tabs.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/src/docgen/templates/default/html/static/tabs.css Wed Oct 31 16:03:11 2007 +0200 @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.nav +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff -r db7e27b5c180 -r 32f4c3cb6a41 trunk/src/docgen/templates/default/html/stylesheet.tpl --- a/trunk/src/docgen/templates/default/html/stylesheet.tpl Wed Oct 31 15:17:20 2007 +0200 +++ b/trunk/src/docgen/templates/default/html/stylesheet.tpl Wed Oct 31 16:03:11 2007 +0200 @@ -1,3 +1,5 @@ +@import "tabs.css"; + body {{ -background: #ccc; +background: #fff; }