library-web r438 - in trunk: . data data/xslt src
- From: fpeters svn gnome org
- To: svn-commits-list gnome org
- Subject: library-web r438 - in trunk: . data data/xslt src
- Date: Tue, 6 May 2008 07:00:32 +0100 (BST)
Author: fpeters
Date: Tue May 6 06:00:32 2008
New Revision: 438
URL: http://svn.gnome.org/viewvc/library-web?rev=438&view=rev
Log:
* data/catalog.xml.in, data/xslt/heading.xsl, data/xslt/indexes.xsl,
src/lgo.py: create single page documents for gnome-doc-utils documents.
(closes: #531243)
Modified:
trunk/ChangeLog
trunk/data/catalog.xml.in
trunk/data/xslt/indexes.xsl
trunk/src/lgo.py
Modified: trunk/data/catalog.xml.in
==============================================================================
--- trunk/data/catalog.xml.in (original)
+++ trunk/data/catalog.xml.in Tue May 6 06:00:32 2008
@@ -75,4 +75,7 @@
<_msgstr msgid="siteaction-support">Support</_msgstr>
<_msgstr msgid="siteaction-development">Development</_msgstr>
<_msgstr msgid="siteaction-community">Community</_msgstr>
+ <_msgstr msgid="allinonepage">
+ Same documents, formatted as a single HTML file
+ </_msgstr>
</msgcat>
Modified: trunk/data/xslt/indexes.xsl
==============================================================================
--- trunk/data/xslt/indexes.xsl (original)
+++ trunk/data/xslt/indexes.xsl Tue May 6 06:00:32 2008
@@ -250,11 +250,11 @@
</p>
</xsl:if>
<xsl:if test="versions">
- <p class="versions">
+ <h4 class="versions">
<xsl:call-template name="gettext"><xsl:with-param name="lang"
select="$lang"/><xsl:with-param name="msgid"
select="'availableversions'"/></xsl:call-template>
- </p>
+ </h4>
<ul class="versions">
<xsl:for-each select="versions/version">
<li>
@@ -267,7 +267,24 @@
</li>
</xsl:for-each>
</ul>
+
+ <h4><xsl:call-template name="gettext"><xsl:with-param name="lang"
+ select="$lang"/><xsl:with-param name="msgid"
+ select="'allinonepage'"/></xsl:call-template></h4>
+ <ul class="versions">
+ <xsl:for-each select="versions/version">
+ <li>
+ <a href="{ href}/{ modulename}" lang="{ lang}"><xsl:value-of select="."/></a>
+ <xsl:if test="@keyword = 'unstable'">
+ (<xsl:call-template name="gettext"><xsl:with-param name="lang"
+ select="$lang"/><xsl:with-param name="msgid"
+ select="'development-version'"/></xsl:call-template>)
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
</xsl:if>
+
</div>
<div class="sidebar">
<xsl:if test="tarballs">
Modified: trunk/src/lgo.py
==============================================================================
--- trunk/src/lgo.py (original)
+++ trunk/src/lgo.py Tue May 6 06:00:32 2008
@@ -26,7 +26,10 @@
from cStringIO import StringIO
from optparse import OptionParser
import logging
-import elementtree.ElementTree as ET
+try:
+ import elementtree.ElementTree as ET
+except ImportError:
+ import xml.etree.ElementTree as ET
import tarfile
import glob
import tempfile
@@ -866,6 +869,25 @@
'--stringparam', 'libgo.lang', lang,
'--stringparam', 'libgo.channel', self.channel,
self.db2html_xsl_file, xml_file]
+ onepage_cmd = cmd[:]
+
+ # 1st, generate a single page with all documentation, and
+ # rename it to $modulename.html.$lang (unless a single page
+ # is the default rendering)
+ if not 'flat-rendering' in quirks:
+ onepage_cmd.insert(5, '--stringparam')
+ onepage_cmd.insert(6, 'db.chunk.max_depth')
+ onepage_cmd.insert(7, '0')
+ logging.debug('executing %s' % ' '.join(onepage_cmd))
+ rc = subprocess.call(onepage_cmd)
+ if rc != 0:
+ logging.warn('%s failed with error %d' % (' '.join(onepage_cmd), rc))
+ index_html = os.path.join(web_output_dir, 'index.html.%s' % lang)
+ if os.path.exists(index_html):
+ os.rename(index_html,
+ os.path.join(web_output_dir, '%s.html.%s' % (doc_module, lang)))
+
+ # 2nd, generate default rendering, to index.html.$lang
if 'flat-rendering' in quirks:
cmd.insert(5, '--stringparam')
cmd.insert(6, 'db.chunk.max_depth')
@@ -881,7 +903,7 @@
rc = subprocess.call(cmd)
if rc != 0:
logging.warn('%s failed with error %d' % (' '.join(cmd), rc))
-
+
if not os.path.exists(xml_index_file):
logging.warn('no index file were created for %s' % doc_module)
continue
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]