From: Florian Brosch Date: Thu, 3 Feb 2011 18:22:16 +0000 (+0100) Subject: doclets: drop deprecated valadoc.org-doclet X-Git-Tag: 0.37.1~3^2~403 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdf29eb4e4f859f3799e75d04fa1c3dab012cad7;p=thirdparty%2Fvala.git doclets: drop deprecated valadoc.org-doclet --- diff --git a/configure.in b/configure.in index 2d606cc1a..7c151ddae 100644 --- a/configure.in +++ b/configure.in @@ -19,11 +19,6 @@ AC_SUBST(VALAC) AC_SUBST(VALAFLAGS) -AC_ARG_ENABLE(valadocorg, AS_HELP_STRING([--enable-valadocorg], []), enable_valadocorg=$enableval, enable_valadocorg=no) -AM_CONDITIONAL(ENABLE_VALADOCORG, test x$enable_valadocorg = xyes) - - - VALA_PACKAGE=libvala-0.12 LIBVALA_REQUIRED=0.11.0 @@ -71,7 +66,6 @@ AC_CONFIG_FILES([Makefile src/libvaladoc/Makefile src/doclets/Makefile src/doclets/htm/Makefile - src/doclets/valadoc.org/Makefile src/doclets/devhelp/Makefile src/doclets/gtkdoc/Makefile src/valadoc/Makefile]) diff --git a/src/Makefile.am b/src/Makefile.am index 6cd599acc..f9718b8ea 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,9 +4,9 @@ NULL = SUBDIRS = \ - libvaladoc \ - valadoc \ + libvaladoc \ + valadoc \ doclets \ - $(NULL) + $(NULL) diff --git a/src/doclets/Makefile.am b/src/doclets/Makefile.am index 20b2e3043..d957a60b7 100644 --- a/src/doclets/Makefile.am +++ b/src/doclets/Makefile.am @@ -5,7 +5,6 @@ NULL = SUBDIRS = htm \ devhelp \ - valadoc.org \ gtkdoc \ $(NULL) diff --git a/src/doclets/valadoc.org/Makefile.am b/src/doclets/valadoc.org/Makefile.am deleted file mode 100755 index 2313124e0..000000000 --- a/src/doclets/valadoc.org/Makefile.am +++ /dev/null @@ -1,57 +0,0 @@ -#src/Makefile.am - - -libdoclet_VALASOURCES = \ - htmlrenderer.vala \ - doclet.vala \ - $(NULL) - - -BUILT_SOURCES = libdoclet.vala.stamp - - -libdoclet.vala.stamp: $(libdoclet_VALASOURCES) - $(VALAC) -C --vapidir $(top_srcdir)/src/libvaladoc/ --vapidir $(top_srcdir)/src/vapi/ --pkg $(VALA_PACKAGE) --pkg gee-1.0 --pkg valadoc-1.0 --basedir . --save-temps $^ - touch $@ - - -docletdir = $(libdir)/valadoc/plugins/valadoc.org - - -doclet_LTLIBRARIES = libdoclet.la - - -libdoclet_la_SOURCES = \ - libdoclet.vala.stamp \ - $(libdoclet_VALASOURCES:.vala=.c) \ - $(NULL) - - - -AM_CFLAGS = -g \ - -DPACKAGE_ICONDIR=\"$(datadir)/valadoc/icons/\" \ - -I ../../libvaladoc/ \ - $(GLIB_CFLAGS) \ - $(LIBGEE_CFLAGS) \ - $(LIBVALA_CFLAGS) \ - $(NULL) - - -libdoclet_la_LDFLAGS = -module -avoid-version -no-undefined - - -libdoclet_la_LIBADD = \ - ../../libvaladoc/libvaladoc.la \ - $(GLIB_LIBS) \ - $(LIBGEE_LIBS) \ - $(LIBVALA_LIBS) \ - $(NULL) - - -EXTRA_DIST = $(libdoclet_VALASOURCES) libdoclet.vala.stamp - - -MAINTAINERCLEANFILES = \ - $(libdoclet_la_SOURCES) \ - $(NULL) - diff --git a/src/doclets/valadoc.org/doclet.vala b/src/doclets/valadoc.org/doclet.vala deleted file mode 100755 index a6eda321a..000000000 --- a/src/doclets/valadoc.org/doclet.vala +++ /dev/null @@ -1,226 +0,0 @@ -/* doclet.vala - * - * Copyright (C) 2008-2009 Florian Brosch - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Florian Brosch - */ - -using Valadoc; -using Valadoc.Api; -using Valadoc.Html; -using Gee; - - - -public class Valadoc.ValadocOrg.Doclet : Valadoc.Html.BasicDoclet { - private string package_dir_name = ""; // remove - - construct { - _renderer = new ValadocOrg.HtmlRenderer (this); - } - - protected override string get_icon_directory () { - return "/images"; - } - - protected override string get_img_path_html (Api.Node element, string type) { - return Path.build_filename ("/doc", element.package.name,"img", element.get_full_name () + "." + type); - } - - private string get_real_path (Api.Node element, string file_extension) { - return GLib.Path.build_filename (this.settings.path, this.package_dir_name, element.get_full_name () + file_extension); - } - - public override void process (Settings settings, Api.Tree tree) { - base.process (settings, tree); - - DirUtils.create (this.settings.path, 0777); - - write_wiki_pages (tree, "", "", Path.build_filename (this.settings.path, this.settings.pkg_name, "content")); - tree.accept (this); - } - - public override void visit_tree (Api.Tree tree) { - tree.accept_children (this); - } - - public override void visit_package (Package package) { - string pkg_name = package.name; - - string path = GLib.Path.build_filename (this.settings.path, pkg_name); - string imgpath = GLib.Path.build_filename (path, "img"); - - var rt = DirUtils.create (path, 0777); - rt = DirUtils.create (imgpath, 0777); - - - this.package_dir_name = pkg_name; - - - // content area: - string filepath = GLib.Path.build_filename (path, "index.content.tpl"); - - WikiPage wikipage = null; - if (this.settings.pkg_name == package.name && this.tree.wikitree != null) { - wikipage = this.tree.wikitree.search ("index.valadoc"); - } - - GLib.FileStream file = GLib.FileStream.open (filepath, "w"); - writer = new Html.MarkupWriter (file, false); - _renderer.set_writer (writer); - write_package_content (package, package, wikipage); - file = null; - - - // navigation: - filepath = GLib.Path.build_filename (path, "index.navi.tpl"); - file = GLib.FileStream.open (filepath, "w"); - writer = new Html.MarkupWriter (file, false); - _renderer.set_writer (writer); - write_navi_package (package); - file = null; - - - package.accept_all_children (this); - } - - private void process_compound_node (Api.Node node) { - if (node.name != null) { - // content area: - string rpath = this.get_real_path (node, ".content.tpl"); - GLib.FileStream file = GLib.FileStream.open (rpath, "w"); - writer = new Html.MarkupWriter (file, false); - _renderer.set_writer (writer); - write_symbol_content (node); - file = null; - - - // navigation: - rpath = this.get_real_path (node, ".navi.tpl"); - file = GLib.FileStream.open (rpath, "w"); - writer = new Html.MarkupWriter (file, false); - _renderer.set_writer (writer); - if (is_internal_node (node)) { - write_navi_symbol (node); - } else { - write_navi_leaf_symbol (node); - } - file = null; - } - - node.accept_all_children (this); - } - - private void process_node (Api.Node node, bool accept_all_children) { - // content area: - string rpath = this.get_real_path (node, ".content.tpl"); - GLib.FileStream file = GLib.FileStream.open (rpath, "w"); - writer = new Html.MarkupWriter (file, false); - _renderer.set_writer (writer); - write_symbol_content (node); - file = null; - - - // navigation: - rpath = this.get_real_path (node, ".navi.tpl"); - file = GLib.FileStream.open (rpath, "w"); - writer = new Html.MarkupWriter (file, false); - _renderer.set_writer (writer); - if (is_internal_node (node)) { - write_navi_symbol (node); - } else { - write_navi_leaf_symbol (node); - } - file = null; - - - if (accept_all_children) { - node.accept_all_children (this); - } - } - - protected override void write_wiki_page (WikiPage page, string contentp, string css_path, string js_path, string pkg_name) { - GLib.FileStream file = GLib.FileStream.open (Path.build_filename(contentp, page.name.ndup(page.name.length-7).replace ("/", ".")+"wiki.tpl"), "w"); - writer = new Html.MarkupWriter (file); - _renderer.set_writer (writer); - _renderer.set_container (page); - _renderer.render (page.documentation); - } - - public override void visit_namespace (Api.Namespace item) { - process_compound_node (item); - } - - public override void visit_interface (Api.Interface item) { - process_compound_node (item); - } - - public override void visit_class (Api.Class item) { - process_compound_node (item); - } - - public override void visit_struct (Api.Struct item) { - process_compound_node (item); - } - - public override void visit_error_domain (Api.ErrorDomain item) { - process_node (item, true); - } - - public override void visit_enum (Api.Enum item) { - process_node (item, true); - } - - public override void visit_property (Api.Property item) { - process_node (item, false); - } - - public override void visit_constant (Api.Constant item) { - process_node (item, false); - } - - public override void visit_field (Api.Field item) { - process_node (item, false); - } - - public override void visit_error_code (Api.ErrorCode item) { - process_node (item, false); - } - - public override void visit_enum_value (Api.EnumValue item) { - process_node (item, false); - } - - public override void visit_delegate (Api.Delegate item) { - process_node (item, false); - } - - public override void visit_signal (Api.Signal item) { - process_node (item, false); - } - - public override void visit_method (Api.Method item) { - process_node (item, false); - } -} - -[ModuleInit] -public Type register_plugin (GLib.TypeModule module) { - return typeof (Valadoc.ValadocOrg.Doclet); -} - diff --git a/src/doclets/valadoc.org/htmlrenderer.vala b/src/doclets/valadoc.org/htmlrenderer.vala deleted file mode 100755 index 31741c272..000000000 --- a/src/doclets/valadoc.org/htmlrenderer.vala +++ /dev/null @@ -1,43 +0,0 @@ -/* htmlrenderer.vala - * - * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: - * Didier 'Ptitjes Villevalois - */ - -using GLib; -using Valadoc.Content; -using Valadoc.Html; - -public class Valadoc.ValadocOrg.HtmlRenderer : Html.HtmlRenderer { - public HtmlRenderer (BasicDoclet doclet) { - base (doclet); - } - - public override void visit_embedded (Embedded element) { - var caption = element.caption; - - var absolute_path = Path.build_filename (_doclet.settings.path, element.package.name, "img", Path.get_basename (element.url)); - var relative_path = Path.build_filename ("/doc", element.package.name, "img", Path.get_basename (element.url)); - - copy_file (element.url, absolute_path); - - writer.image (relative_path, (caption == null || caption == "") ? "" : caption); - } -} -