Mercurial > projects > dil
view trunk/src/docgen/page/plaintextwriter.d @ 466:db7e27b5c180
Fixed parts of HTML output, some reorganizing.
author | Jari-Matti M?kel? <jmjm@iki.fi> |
---|---|
date | Wed, 31 Oct 2007 15:17:20 +0200 |
parents | 33a4cb255fcc |
children | e48a011e687a |
line wrap: on
line source
/** * Author: Jari-Matti Mäkelä * License: GPL3 */ module docgen.page.plaintextwriter; import docgen.page.writer; import docgen.misc.textutils; import tango.io.FileConduit : FileConduit; //TODO: this is mostly broken now /** * Writes a plain text document skeleton. */ class PlainTextWriter : AbstractPageWriter!("plaintext") { this(PageWriterFactory factory, OutputStream[] outputs) { super(factory, outputs); } void generateTOC(Module[] modules) { // TODO print.format(getTemplate("toc")); } void generateModuleSection() { // TODO print.format(getTemplate("modules")); } void generateListingSection() { // TODO print.format(getTemplate("listings")); } void generateDepGraphSection() { // TODO print.format(getTemplate("dependencies")); } void generateIndexSection() { } void generateLastPage() { } void generateFirstPage() { print( plainTextHeading(factory.options.templates.title ~ " Reference Manual") ~ factory.options.templates.versionString ~ \n ~ "Generated by " ~ docgen_version ~ \n ~ timeNow() ~ \n \n \n ~ plainTextHorizLine() ~ \n \n ~ plainTextHeading("Table of Contents") ~ \n ~ plainTextHeading("Module documentation") ~ \n ~ plainTextHeading("File listings") ~ \n ~ plainTextHeading("Dependency diagram") ~ \n ); } void addList(char[][] contents, bool ordered) { uint[] counters; foreach(item; contents) { switch(item) { case "(": counters ~= 1; continue; case ")": counters.length = counters.length - 1; continue; default: if (counters.length>0) for (int i=0; i <= counters.length; i++) print(" "); if (ordered) print(++counters[$-1])(". ")(item)(\n); else print("* ")(item)(\n); } } } }