annotate src/docgen/page/xmlwriter.d @ 806:bcb74c9b895c

Moved out files in the trunk folder to the root.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Sun, 09 Mar 2008 00:12:19 +0100
parents trunk/src/docgen/page/xmlwriter.d@db7e27b5c180
children
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 */
466
db7e27b5c180 Fixed parts of HTML output, some reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 457
diff changeset
16 class XMLWriter : AbstractPageWriter!("xml", 1) {
457
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
466
db7e27b5c180 Fixed parts of HTML output, some reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 457
diff changeset
23 print.format(getTemplate("toc"));
457
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
466
db7e27b5c180 Fixed parts of HTML output, some reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 457
diff changeset
28 print.format(getTemplate("modules"));
457
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
466
db7e27b5c180 Fixed parts of HTML output, some reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 457
diff changeset
33 print.format(getTemplate("listings"));
457
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
466
db7e27b5c180 Fixed parts of HTML output, some reorganizing.
Jari-Matti M?kel? <jmjm@iki.fi>
parents: 457
diff changeset
38 print.format(getTemplate("dependencies"));
457
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 }