1 /* devhelp-markupwriter.vala
3 * Copyright (C) 2008-2009 Florian Brosch
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Florian Brosch <flo.brosch@gmail.com>
24 public class Valadoc
.Devhelp
.MarkupWriter
: Valadoc
.MarkupWriter
{
26 public MarkupWriter (FileStream stream
, bool xml_declaration
= true) {
27 // avoid broken implicit copy
28 unowned FileStream _stream
= stream
;
30 base ((str
) => { _stream
.printf (str
); }, xml_declaration
);
33 protected override bool inline_element (string name
) {
34 return name
!= "book";
37 protected override bool content_inline_element (string name
) {
38 return name
== "keyword"
42 public unowned MarkupWriter
start_book (string title
, string lang
, string link
, string name
, string version
, string author
) {
43 this
.start_tag ("book", {"xmlns", "http://www.devhelp.net/book",
53 public unowned MarkupWriter
end_book () {
54 this
.end_tag ("book");
58 public unowned MarkupWriter
start_functions () {
59 this
.start_tag ("functions");
63 public unowned MarkupWriter
end_functions () {
64 this
.end_tag ("functions");
68 public unowned MarkupWriter
start_chapters () {
69 this
.start_tag ("chapters");
73 public unowned MarkupWriter
end_chapters () {
74 this
.end_tag ("chapters");
78 public unowned MarkupWriter
start_sub (string name
, string link
) {
79 this
.start_tag ("sub", {"name", name
, "link", link
});
83 public unowned MarkupWriter
end_sub () {
88 public unowned MarkupWriter
keyword (string name
, string type
, string link
) {
89 this
.start_tag ("keyword", {"type", type
, "name", name
, "link", link
});
90 this
.end_tag ("keyword");