[valadoc] markupwriter: move xml-declaration back to the constructor + flag
- From: Florian Brosch <flobrosch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [valadoc] markupwriter: move xml-declaration back to the constructor + flag
- Date: Wed, 28 Oct 2009 13:06:25 +0000 (UTC)
commit f074c95db621bdb37a6b007f140a7e44b84c1c61
Author: Florian Brosch <flo brosch gmail com>
Date: Wed Oct 28 01:24:14 2009 +0100
markupwriter: move xml-declaration back to the constructor + flag
src/doclets/devhelp/doclet.vala | 4 ----
src/doclets/htm/doclet.vala | 4 ----
src/doclets/valadoc.org/doclet.vala | 2 +-
src/libvaladoc/devhelp-markupwriter.vala | 4 ++--
src/libvaladoc/html/basicdoclet.vala | 1 -
src/libvaladoc/html/htmlmarkupwriter.vala | 4 ++--
src/libvaladoc/markupwriter.vala | 10 ++++------
7 files changed, 9 insertions(+), 20 deletions(-)
---
diff --git a/src/doclets/devhelp/doclet.vala b/src/doclets/devhelp/doclet.vala
index edc9e25..69a823a 100755
--- a/src/doclets/devhelp/doclet.vala
+++ b/src/doclets/devhelp/doclet.vala
@@ -162,13 +162,11 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
var devfile = FileStream.open (devpath, "w");
_devhelpwriter = new Devhelp.MarkupWriter (devfile);
- _devhelpwriter.xml_declaration ();
_devhelpwriter.start_book (pkg_name+" Reference Manual", "vala", "index.htm", "", "", "");
GLib.FileStream file = GLib.FileStream.open (filepath, "w");
writer = new Html.MarkupWriter (file);
- writer.xml_declaration ();
_renderer.set_writer (writer);
write_file_header (this.css_path, pkg_name);
write_package_content (package, package, wikipage);
@@ -214,7 +212,6 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
if (node.name != null) {
GLib.FileStream file = GLib.FileStream.open (rpath, "w");
writer = new Html.MarkupWriter (file);
- writer.xml_declaration ();
_renderer.set_writer (writer);
write_file_header (css_path, node.full_name ());
write_symbol_content (node);
@@ -238,7 +235,6 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
GLib.FileStream file = GLib.FileStream.open (rpath, "w");
writer = new Html.MarkupWriter (file);
- writer.xml_declaration ();
_renderer.set_writer (writer);
write_file_header (css_path, node.full_name());
write_symbol_content (node);
diff --git a/src/doclets/htm/doclet.vala b/src/doclets/htm/doclet.vala
index 6e0d93a..4c4bc40 100755
--- a/src/doclets/htm/doclet.vala
+++ b/src/doclets/htm/doclet.vala
@@ -126,7 +126,6 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
GLib.FileStream file = GLib.FileStream.open (GLib.Path.build_filename ( settings.path, "index.html" ), "w");
writer = new Html.MarkupWriter (file);
- writer.xml_declaration ();
_renderer.set_writer (writer);
write_file_header (this.css_path_package, settings.pkg_name);
write_navi_packages (tree);
@@ -150,7 +149,6 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
GLib.FileStream file = GLib.FileStream.open (GLib.Path.build_filename ( path, "index.htm" ), "w");
writer = new Html.MarkupWriter (file);
- writer.xml_declaration ();
_renderer.set_writer (writer);
write_file_header (this.css_path, pkg_name);
write_navi_package (package);
@@ -167,7 +165,6 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
if (ns.name != null) {
GLib.FileStream file = GLib.FileStream.open (rpath, "w");
writer = new Html.MarkupWriter (file);
- writer.xml_declaration ();
_renderer.set_writer (writer);
write_file_header (this.css_path, ns.full_name ());
write_navi_symbol (ns);
@@ -184,7 +181,6 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
GLib.FileStream file = GLib.FileStream.open (rpath, "w");
writer = new Html.MarkupWriter (file);
- writer.xml_declaration ();
_renderer.set_writer (writer);
write_file_header (css_path, node.full_name());
if (is_internal_node (node)) {
diff --git a/src/doclets/valadoc.org/doclet.vala b/src/doclets/valadoc.org/doclet.vala
index 9e4959e..1ec23b4 100755
--- a/src/doclets/valadoc.org/doclet.vala
+++ b/src/doclets/valadoc.org/doclet.vala
@@ -127,7 +127,7 @@ public class Valadoc.ValadocOrg.Doclet : BasicDoclet {
string parentnodetypepath = (parentnodepkgname == parentnodename)? parentnodepkgname : parentnodepkgname+"/"+parentnodename;
string typepath = pkgname+"/"+fullname;
this.file.printf ("INSERT INTO `ValadocCodeElement` (`id`, `parent`, `valaapi`) VALUES ((SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1), (SELECT `id` FROM `ValadocApiElement` WHERE BINARY `fullname`='%s' LIMIT 1), '", typepath, parentnodetypepath);
- var writer = new Html.MarkupWriter (file);
+ var writer = new Html.MarkupWriter (file, false);
writer.set_wrap (false);
_renderer.set_writer (writer);
_renderer.set_container (element);
diff --git a/src/libvaladoc/devhelp-markupwriter.vala b/src/libvaladoc/devhelp-markupwriter.vala
index 6bc00b9..4a0b2b5 100644
--- a/src/libvaladoc/devhelp-markupwriter.vala
+++ b/src/libvaladoc/devhelp-markupwriter.vala
@@ -21,8 +21,8 @@
*/
public class Valadoc.Devhelp.MarkupWriter : Valadoc.MarkupWriter {
- public MarkupWriter (FileStream stream) {
- base (stream);
+ public MarkupWriter (FileStream stream, bool xml_declaration = true) {
+ base (stream, xml_declaration);
}
protected override bool inline_element (string name) {
diff --git a/src/libvaladoc/html/basicdoclet.vala b/src/libvaladoc/html/basicdoclet.vala
index 81486fd..a523cb8 100755
--- a/src/libvaladoc/html/basicdoclet.vala
+++ b/src/libvaladoc/html/basicdoclet.vala
@@ -87,7 +87,6 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
if (page.name != "index.valadoc") {
GLib.FileStream file = GLib.FileStream.open (Path.build_filename(contentp, page.name.ndup(page.name.len()-7).replace ("/", ".")+"html"), "w");
writer = new MarkupWriter (file);
- writer.xml_declaration ();
_renderer.set_writer (writer);
this.write_file_header (css_path_wiki, this.settings.pkg_name);
_renderer.set_container (page);
diff --git a/src/libvaladoc/html/htmlmarkupwriter.vala b/src/libvaladoc/html/htmlmarkupwriter.vala
index 7e85e69..004a704 100755
--- a/src/libvaladoc/html/htmlmarkupwriter.vala
+++ b/src/libvaladoc/html/htmlmarkupwriter.vala
@@ -24,8 +24,8 @@ using GLib;
using Valadoc.Content;
public class Valadoc.Html.MarkupWriter : Valadoc.MarkupWriter {
- public MarkupWriter (FileStream stream) {
- base (stream);
+ public MarkupWriter (FileStream stream, bool xml_declaration = true) {
+ base (stream, xml_declaration);
}
// edit
diff --git a/src/libvaladoc/markupwriter.vala b/src/libvaladoc/markupwriter.vala
index 640cfdf..32ceffe 100644
--- a/src/libvaladoc/markupwriter.vala
+++ b/src/libvaladoc/markupwriter.vala
@@ -31,13 +31,11 @@ public class Valadoc.MarkupWriter {
private const int MAX_COLUMN = 150;
- public MarkupWriter (FileStream stream) {
+ public MarkupWriter (FileStream stream, bool xml_declaration = true) {
this.stream = stream;
- last_was_tag = true;
- }
-
- public void xml_declaration () {
- do_write ("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
+ if (xml_declaration) {
+ do_write ("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
+ }
indent = -1;
last_was_tag = true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]