Release 0.41.92
[vala-gnome.git] / libvaladoc / gtkdocmarkupwriter.vala
blob1e727678983d5912f7b85045004d1de8656ecb07
1 /* gtkdocmarkupwriter.vala
3 * Copyright (C) 2012 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
19 * Author:
20 * Florian Brosch <flo.brosch@gmail.com>
25 public class Valadoc.GtkDocMarkupWriter : Valadoc.MarkupWriter {
26 private unowned StringBuilder builder;
28 public void reset () {
29 last_was_tag = true;
30 current_column = 0;
31 builder.erase ();
32 indent = -1;
35 public unowned string content {
36 get { return builder.str; }
39 public GtkDocMarkupWriter () {
40 StringBuilder builder = new StringBuilder ();
41 base ((str) => { builder.append (str); }, false);
42 this.builder = builder;
45 protected override bool inline_element (string name) {
46 return name != "para"
47 && name != "programlisting"
48 && name != "table"
49 && name != "example"
50 && name != "figure"
51 && name != "tr"
52 && name != "td"
53 && name != "mediaobject"
54 && name != "imageobject"
55 && name != "textobject"
56 && name != "listitem"
57 && name != "orderedlist"
58 && name != "itemizedlist"
59 && name != "title";
62 protected override bool content_inline_element (string name) {
63 return name == "para"
64 || name == "programlisting"
65 || name == "emphasis"
66 || name == "blockquote"
67 || name == "ulink"
68 || name == "listitem"
69 || name == "title";