comparison trunk/src/docgen/page/plaintextwriter.d @ 470:e48a011e687a

Initial plain text output support.
author Jari-Matti M?kel? <jmjm@iki.fi>
date Wed, 31 Oct 2007 23:03:56 +0200
parents db7e27b5c180
children
comparison
equal deleted inserted replaced
469:e562d455cbbe 470:e48a011e687a
6 6
7 import docgen.page.writer; 7 import docgen.page.writer;
8 import docgen.misc.textutils; 8 import docgen.misc.textutils;
9 import tango.io.FileConduit : FileConduit; 9 import tango.io.FileConduit : FileConduit;
10 10
11 //TODO: this is mostly broken now
12
13 /** 11 /**
14 * Writes a plain text document skeleton. 12 * Writes a plain text document skeleton.
15 */ 13 */
16 class PlainTextWriter : AbstractPageWriter!("plaintext") { 14 class PlainTextWriter : AbstractPageWriter!("plaintext") {
17 this(PageWriterFactory factory, OutputStream[] outputs) { 15 this(PageWriterFactory factory, OutputStream[] outputs) {
18 super(factory, outputs); 16 super(factory);
19 } 17 }
20 18
21 void generateTOC(Module[] modules) { 19 override void generateTOC(Module[] modules) {
22 // TODO
23 print.format(getTemplate("toc")); 20 print.format(getTemplate("toc"));
24 } 21 }
25 22
26 void generateModuleSection() { 23 override void generateModuleSection(Module[] modules) {
27 // TODO
28 print.format(getTemplate("modules")); 24 print.format(getTemplate("modules"));
29 } 25 }
30 26
31 void generateListingSection() { 27 override void generateListingSection(Module[] modules) {
32 // TODO
33 print.format(getTemplate("listings")); 28 print.format(getTemplate("listings"));
34 } 29 }
35 30
36 void generateDepGraphSection() { 31 void generateDepGraphSection() {
37 // TODO
38 print.format(getTemplate("dependencies")); 32 print.format(getTemplate("dependencies"));
39 } 33 }
40 34
41 void generateIndexSection() { }
42
43 void generateLastPage() { }
44
45 void generateFirstPage() { 35 void generateFirstPage() {
46 print( 36 print.format(getTemplate("firstpage"),
47 plainTextHeading(factory.options.templates.title ~ " Reference Manual") ~ 37 plainTextHeading(factory.options.templates.title ~ " Reference Manual"),
48 factory.options.templates.versionString ~ \n ~ 38 factory.options.templates.versionString,
49 "Generated by " ~ docgen_version ~ \n ~ 39 docgen_version,
50 timeNow() ~ \n \n \n ~ 40 timeNow()
51 plainTextHorizLine() ~ \n \n ~
52 plainTextHeading("Table of Contents") ~ \n ~
53 plainTextHeading("Module documentation") ~ \n ~
54 plainTextHeading("File listings") ~ \n ~
55 plainTextHeading("Dependency diagram") ~ \n
56 ); 41 );
57 } 42 }
58 43
59 void addList(char[][] contents, bool ordered) { 44 void addList(char[][] contents, bool ordered) {
60 uint[] counters; 45 uint[] counters;