Mercurial > projects > dil
view trunk/src/docgen/templates/htmlwriter.d @ 444:0bda71dc9c4f
More document template and source listing code.
author | Jari-Matti M?kel? <jmjm@iki.fi> |
---|---|
date | Wed, 17 Oct 2007 03:12:46 +0300 |
parents | |
children | 49f3afd6a0e8 |
line wrap: on
line source
/** * Author: Jari-Matti Mäkelä * License: GPL3 */ module docgen.templates.htmlwriter; import docgen.templates.writer; import tango.io.FileConduit : FileConduit; import tango.io.Print: Print; import tango.text.convert.Layout : Layout; /** * Writes a HTML document skeleton. */ class HTMLWriter : AbstractTemplateWriter { this(TemplateWriterFactory factory, OutputStream[] outputs) { super(factory, outputs); assert(outputs.length == 1, "Wrong number of outputs"); } void generateTemplate() { auto output = new Print!(char)(new Layout!(char), outputs[0]); output(` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>` ~ factory.options.title ~ ` Reference Manual</title> <meta name="AUTHOR" content="` ~ factory.options.copyright ~ `" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="style.css" media="all" title="default" /> <link rel="stylesheet" href="print.css" media="print" /> </head> <body> <h1>` ~ factory.options.title ~ ` Reference Manual</h1> <h2>` ~ factory.options.versionString ~ `</h2> <h2>Generated by ` ~ docgen_version ~ `</h2> <h3>` ~ timeNow() ~ `</h3> <hr /> <h2>Table of Contents</h2> <hr /> <h2>Module documentation</h2> <hr /> <h2>File listings</h2> <hr /> <h2>Dependency diagram</h2> </body> </html>`); } }