summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@src.gnome.org>2008-02-14 02:54:43 +0000
committerJonathon Jongsma <jjongsma@src.gnome.org>2008-02-14 02:54:43 +0000
commit160a2d2c05044d9e364be720ee5d4706f73f93d2 (patch)
treedf4ddbc1e5f78a80aafcdb6d42b0e02d59275f98 /docs
parent7b508f880f330f8252066b901db67516186df179 (diff)
downloadglibmm-160a2d2c05044d9e364be720ee5d4706f73f93d2.tar.gz
generate and install a devhelp book for glibmm like we do for gtkmm. It
* docs/reference/Doxyfile.in: * docs/reference/Makefile.am: * docs/reference/doxygen_to_devhelp.xsl: generate and install a devhelp book for glibmm like we do for gtkmm. It would be nice to make the xsl stylesheet general and shared between gtkmm and glibmm (and eventually other libraries as well), but for now I just duplicated it here svn path=/trunk/; revision=599
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/Doxyfile.in2
-rw-r--r--docs/reference/Makefile.am20
-rw-r--r--docs/reference/doxygen_to_devhelp.xsl94
3 files changed, 113 insertions, 3 deletions
diff --git a/docs/reference/Doxyfile.in b/docs/reference/Doxyfile.in
index 75d19cd1..f1e5452c 100644
--- a/docs/reference/Doxyfile.in
+++ b/docs/reference/Doxyfile.in
@@ -773,7 +773,7 @@ MAN_LINKS = NO
# feature is still experimental and incomplete at the
# moment.
-GENERATE_XML = NO
+GENERATE_XML = YES
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index ba5a0b8b..68906c1a 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -3,14 +3,24 @@ doxygen_configfile_source = $(srcdir)/Doxyfile.in
beautify_docs_source = $(srcdir)/beautify_docs.pl.in
beautify_docs = $(srcdir)/beautify_docs.pl
+devhelp_file = glibmm-2.4.devhelp
+devhelp_stylesheet = doxygen_to_devhelp.xsl
+
include $(top_srcdir)/docs/Makefile_web.am_fragment
web_path_reference = $(web_path_docs)reference
EXTRA_DIST = README Doxyfile.in \
glibmm_header.html_fragment glibmm_footer.html_fragment beautify_docs.pl \
- html glibmm_doxygen_tags libstdc++.tag.xml
+ html glibmm_doxygen_tags libstdc++.tag.xml doxygen_to_devhelp.xsl $(devhelp_file)
#Ideally, libstdc++.tag.xml would be installed by gcc, instead of being copied into every project.
+# the xml output is made along with the html output
+xml/index.xml: html/index.html
+
+# Build a DevHelp reference from the doxygen xml
+$(devhelp_file): xml/index.xml $(devhelp_stylesheet)
+ xsltproc -o $@ $(devhelp_stylesheet) xml/index.xml
+
html/index.html: $(doxygen_configfile_source) $(beautify_docs_source) $(top_srcdir)/glib/glibmm/*.h
-rm -rf html
image_path=""; \
@@ -33,12 +43,15 @@ post-html: html/index.html
doc-clean:
-rm -rf html
+ -rm -rf xml
+ -rm -f $(devhelp_file)
-rm -f glibmm_doxygen_tags
-rm -f glibmm-reference-html.tar.gz glibmm-reference-html.tar.bz2
referencedir = $(gtkmm_docdir)/reference/html
+devhelpdir = $(datadir)/devhelp/books/glibmm-2.4
-install-reference: html/index.html
+install-reference: html/index.html $(devhelp_file)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(referencedir)
@dir='$(<D)'; for p in $$dir/*.html $$dir/*.css $$dir/*.png $$dir/*.dot ; do \
@@ -46,6 +59,8 @@ install-reference: html/index.html
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(referencedir)/$$f"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(referencedir)/$$f; \
done
+ $(mkinstalldirs) $(DESTDIR)$(devhelpdir)
+ $(INSTALL_DATA) $(srcdir)/$(devhelp_file) $(DESTDIR)$(devhelpdir)/$$f;
uninstall-reference: html/index.html
@$(NORMAL_UNINSTALL)
@@ -54,6 +69,7 @@ uninstall-reference: html/index.html
echo " rm -f $(DESTDIR)$(referencedir)/$$f"; \
rm -f $(DESTDIR)$(referencedir)/$$f; \
done
+ rm -f $(DESTDIR)$(devhelpdir)/$(devhelp_file)
# Install beautify_docs.pl, next to gmmproc.
gmmproc_bin_SCRIPTS = $(beautify_docs)
diff --git a/docs/reference/doxygen_to_devhelp.xsl b/docs/reference/doxygen_to_devhelp.xsl
new file mode 100644
index 00000000..cb84da14
--- /dev/null
+++ b/docs/reference/doxygen_to_devhelp.xsl
@@ -0,0 +1,94 @@
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+<xsl:output method="xml" version="1.0" indent="yes"/>
+
+<xsl:param name="reference_prefix">../../../doc/glibmm-2.4/docs/reference/html/</xsl:param>
+
+<xsl:template match="/">
+ <book title="glibmm 2.4 library Reference Manual"
+ name="glibmm 2.4"
+ link="{$reference_prefix}/index.html">
+ <chapters>
+ <sub name="Classes" link="{$reference_prefix}classes.html">
+ <xsl:apply-templates select="doxygenindex/compound[@kind='class']">
+ <xsl:sort select="."/>
+ </xsl:apply-templates>
+ </sub>
+ <sub name="Namespaces" link="{$reference_prefix}namespaces.html">
+ <xsl:apply-templates select="doxygenindex/compound[@kind='namespace']">
+ <xsl:sort select="."/>
+ </xsl:apply-templates>
+ </sub>
+ </chapters>
+
+ <functions>
+ <!-- @todo: maybe select only the real functions, ie those with kind=="function"? -->
+ <xsl:apply-templates select="doxygenindex/compound/member" mode="as-function"/>
+ </functions>
+ </book>
+</xsl:template>
+
+<xsl:template match="compound">
+ <xsl:param name="name"><xsl:value-of select="name"/></xsl:param>
+ <xsl:param name="link"><xsl:value-of select="@refid"/>.html</xsl:param>
+ <sub name="{$name}" link="{$reference_prefix}{$link}">
+ <xsl:apply-templates select="member" mode="as-sub">
+ <xsl:sort select="."/>
+ </xsl:apply-templates>
+ </sub>
+</xsl:template>
+
+<xsl:template match="member" mode="as-function">
+ <!--
+ <function name="atk_set_value" link="atk-atkvalue.html#ATK-SET-VALUE"/>
+ -->
+ <xsl:variable name="fqn">
+ <xsl:call-template name="get-fully-qualified-name" />
+ </xsl:variable>
+ <xsl:variable name="link">
+ <xsl:call-template name="get-member-link" />
+ </xsl:variable>
+ <function name="{$fqn}" link="{$reference_prefix}{$link}"/>
+</xsl:template>
+
+<xsl:template match="member" mode="as-sub">
+ <xsl:variable name="fqn">
+ <xsl:call-template name="get-fully-qualified-name" />
+ </xsl:variable>
+ <xsl:variable name="link">
+ <xsl:call-template name="get-member-link" />
+ </xsl:variable>
+ <sub name="{$fqn}" link="{$reference_prefix}{$link}"/>
+</xsl:template>
+
+
+<!-- get a url link for the current member node.
+ The source xml looks like this:
+ <compound refid="classGtk_1_1AboutDialog" kind="class"><name>Gtk::AboutDialog</name>
+ <member refid="classGtk_1_1AboutDialog_1ad14950354fa1d9e7d02e951bd0f232e" kind="typedef"><name>SlotActivateLink</name></member>
+
+ The URL for the member function is obtained by adding '.html' to the refid of
+ the parent node. The in-page anchor id is the portion of the child's refid
+ that is different than the parent's refid, but without the leading '_1'
+ So, in the example above, the url would be:
+ classGtk_1_1AboutDialog.html#ad14950354fa1d9e7d02e951bd0f232e
+-->
+<xsl:template name="get-member-link">
+ <xsl:variable name="offset">
+ <xsl:value-of select="string-length(../@refid) + 3"/>
+ </xsl:variable>
+ <xsl:value-of select="concat(../@refid, '.html#', substring(@refid, $offset))"/>
+</xsl:template>
+
+<!-- Get the fully qualified name for the current class member node -->
+<xsl:template name="get-fully-qualified-name">
+ <xsl:value-of select="concat(../name, '::', name)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
+<!-- vim:ts=2 sw=2:
+-->