annotate trunk/src/docgen/page/xmlwriter.d @ 457:33a4cb255fcc

Cached images, small fixes, reorganizing.
author Jari-Matti M?kel? <jmjm@iki.fi>
date Tue, 30 Oct 2007 15:41:30 +0200
parents
children db7e27b5c180
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
457
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
1 /**
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
2 * Author: Jari-Matti Mäkelä
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
3 * License: GPL3
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
4 */
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
5 module docgen.page.xmlwriter;
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
6
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
7 import docgen.page.writer;
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
8 import docgen.misc.textutils;
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
9 import tango.io.FileConduit : FileConduit;
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
10
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
11 //TODO: this is mostly broken now
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
12
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
13 /**
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
14 * TODO
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
15 */
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
16 class XMLWriter : AbstractPageWriter!(2, "xml") {
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
17 this(PageWriterFactory factory, OutputStream[] outputs) {
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
18 super(factory, outputs);
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
19 }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
20
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
21 void generateTOC(Module[] modules) {
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
22 // TODO
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
23 print.format(templates["toc"]);
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
24 }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
25
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
26 void generateModuleSection() {
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
27 // TODO
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
28 print.format(templates["modules"]);
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
29 }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
30
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
31 void generateListingSection() {
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
32 // TODO
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
33 print.format(templates["listings"]);
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
34 }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
35
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
36 void generateDepGraphSection() {
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
37 // TODO
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
38 print.format(templates["dependencies"]);
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
39 }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
40
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
41 void generateIndexSection() { }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
42
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
43 void generateLastPage() { }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
44
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
45 void generateFirstPage() { }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
46
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
47 void addList(char[][] contents, bool ordered) {
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
48 foreach(item; contents) {
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
49 switch(item) {
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
50 case "(": print(ordered ? "<ol>" : "<ul>"); continue;
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
51 case ")": print(ordered ? "</ol>" : "</ul>"); continue;
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
52 default: print("<li>")(xml_escape(item))("</li>");
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
53 }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
54 }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
55 }
33a4cb255fcc Cached images, small fixes, reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents:
diff changeset
56 }