Mercurial > projects > dil
view trunk/src/docgen/templates/htmlwriter.d @ 448:c82b36b9cadf
Simpler writer hierarchy.
author | Jari-Matti M?kel? <jmjm@iki.fi> |
---|---|
date | Wed, 17 Oct 2007 19:23:56 +0300 |
parents | 49f3afd6a0e8 |
children |
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; // TODO: this is mostly broken now /** * Writes a HTML document skeleton. */ class HTMLWriter : AbstractWriter!(TemplateWriterFactory, 2), TemplateWriter { this(TemplateWriterFactory factory, OutputStream[] outputs) { super(factory, 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.templates.title ~ ` Reference Manual</title> <meta name="AUTHOR" content="` ~ factory.options.templates.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.templates.title ~ ` Reference Manual</h1> <h2>` ~ factory.options.templates.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>`); } }