Add missing xref.html XSLT postprocessing
g0dil [Wed, 25 Apr 2007 15:32:00 +0000 (15:32 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@234 270642c3-0616-0410-b53a-bc976706d245

doclib/SConscript
senfscons/SENFSCons.py

index ddaa95e..c3303e3 100644 (file)
@@ -64,12 +64,22 @@ div.tabs ul li.$projectname a {obr} background-color: #EDE497; {cbr}
   <div id="content2">
     <div class="tabs menu">
       <ul>
-{{ for name, path in modules():
-        <li class="{name}"><a href="@TOPDIR@/{path}/index.html">{name}</a></li>
+{{      for name, path in modules():
+          <li class="{name}"><a href="@TOPDIR@/{path}/index.html">{name}</a></li>
 }}
       </ul>
     </div>"""
 
+OVERVIEW_EXTRA_HEADER="""
+    <div class="tabs">
+      <ul>
+      <li><a href="@TOPDIR@/doc/html/xref.html">Open Issues</a></li>
+        <li><a class="ext" href="http://svn.berlios.de/wsvn/senf/?op=log&rev=0&sc=0&isdir=1">SVN ChangeLog</a></li>
+        <li><a class="ext" href="http://developer.berlios.de/projects/senf">SENF @ BerliOS</a></li>
+        <li><a class="ext" href="http://openfacts.berlios.de/index-en.phtml?title=SENF+Network+Framework">Wiki</a></li>
+      </ul>
+    </div>"""
+
 FOOTER = """<hr style="width:0px;border:none;clear:both;margin:0;padding:0" />
   </div>
 </div>
@@ -81,16 +91,6 @@ FOOTER = """<hr style="width:0px;border:none;clear:both;margin:0;padding:0" />
 </div>
 </body></html>"""
 
-OVERVIEW_EXTRA_HEADER="""
-    <div class="tabs">
-      <ul>
-        <li><a href="xref.html">Open Issues</a></li>
-        <li><a class="ext" href="http://svn.berlios.de/wsvn/senf/?op=log&rev=0&sc=0&isdir=1">SVN ChangeLog</a></li>
-        <li><a class="ext" href="http://developer.berlios.de/projects/senf">SENF @ BerliOS</a></li>
-        <li><a class="ext" href="http://openfacts.berlios.de/index-en.phtml?title=SENF+Network+Framework">Wiki</a></li>
-      </ul>
-    </div>"""
-
 SEARCH_PHP="""
 <?php include 'search_functions.php'; ?>
 <?php search(); ?>"""
@@ -98,8 +98,8 @@ SEARCH_PHP="""
 SEARCH_PATHS_PHP="""<?php
 function paths() {
   return array(
-{{ for index in indices():
-    "../{index}/",
+{{  for index in indices():
+      "../{index}/",
 }}
   );
 }
@@ -117,11 +117,11 @@ env.Alias('all_docs',
           env.Command('search.php', 'html-munge.xsl',
                       [ writeTemplate,
                         'xsltproc --nonet --html --stringparam topdir .. -o - $SOURCE $TARGET 2>/dev/null'
-                        + r'| sed -e "s/\[\[/</g" -e "s/\]\]/>/g" > ${TARGET}.tmp',
+                        + r'| sed -e "s/\[\[/<?/g" -e "s/\]\]/?>/g" > ${TARGET}.tmp',
                         'mv ${TARGET}.tmp ${TARGET}' ],
                       TEMPLATE = (HEADER
                                   + OVERVIEW_EXTRA_HEADER
-                                  + SEARCH_PHP.replace('<','[[').replace('>',']]')
+                                  + SEARCH_PHP.replace('<?','[[').replace('?>',']]')
                                   + FOOTER),
                       TITLE = "Search results"))
 env.Alias('all_docs',
index 10ca5f7..d87f229 100644 (file)
@@ -450,14 +450,32 @@ def DoxyXRef(env, docs=None,
 
     commands = []
     if HTML_HEADER:
-        commands.append(
-            "sed -e 's/\\$$title/$TITLE/g' -e 's/\\$$projectname/Overview/g' ${SOURCES[2]} > $TARGET")
-    commands.append("xsltproc --stringparam title '$TITLE' --stringparam types '$DOXY_XREF_TYPES' ${SOURCES[1]} $SOURCE >> $TARGET")
+        commands.append("sed" +
+                        " -e 's/\\$$title/$TITLE/g'" +
+                        " -e 's/\\$$projectname/Overview/g'" +
+                        " ${SOURCES[2]} > $TARGET")
+    commands.append("xsltproc" +
+                    " --stringparam title '$TITLE'" +
+                    " --stringparam types '$DOXY_XREF_TYPES'" +
+                    " ${SOURCES[1]} $SOURCE >> $TARGET")
     if HTML_FOOTER:
         commands.append(
             "sed -e 's/\\$$title/$TITLE/g' -e 's/\\$$projectname/Overview/g' ${SOURCES[%d]} >> $TARGET"
             % (HTML_HEADER and 3 or 2))
 
+    if env.get('DOXY_HTML_XSL'):
+        xslfile = env.File(env['DOXY_HTML_XSL'])
+        reltopdir = '../' * len(xref[0].dir.abspath[len(env.Dir('#').abspath)+1:].split('/'))
+        if reltopdir : reltopdir = reltopdir[:-1]
+        else         : reltopdir = '.'
+        commands.append(("xsltproc -o ${TARGET}.tmp" +
+                         " --nonet --html" +
+                         " --stringparam topdir %s" +
+                         " ${SOURCES[-1]} $TARGET 2>/dev/null")
+                        % reltopdir)
+        commands.append("mv ${TARGET}.tmp ${TARGET}")
+        sources.append(xslfile)
+        
     xref = env.Command("doc/html/xref.html", sources, commands,
                        TITLE = TITLE)