SENFSCons.GlobalTargets(env)
SENFSCons.Doxygen(env)
-#, extra_sources = [
-# 'Examples/Sniffer/Sniffer.cc',
-#])
SENFSCons.DoxyXRef(env,
HTML_HEADER = '#/doclib/doxy-header-overview.html',
HTML_FOOTER = '#/doclib/doxy-footer.html')
+SENFSCons.DoxySearch(env)
# Create Doxyfile.local if not cleaning and the file does not exist
# otherwise doxygen will barf on this non-existent file
--- /dev/null
+# -*- python -*-
+
+Import('env')
+import SENFSCons
+
+###########################################################################
+
+# This is not nice .. really ...
+env.Alias(
+ 'all_docs',
+ env.Command('search.php',
+ [ 'doxy-header-overview.html', 'doxy-footer.html', 'html-munge.xsl' ],
+ [ "sed -e 's/\\$$title/Search results/g' -e 's/\\$$projectname/Overview/g' ${SOURCES[0]} > ${TARGET}.tmp",
+ 'echo "PHPSEARCH" >> ${TARGET}.tmp',
+ 'cat ${SOURCES[1]} >> ${TARGET}.tmp',
+ 'xsltproc --nonet --html --stringparam topdir .. -o - ${SOURCES[2]} ${TARGET}.tmp 2>/dev/null'
+ + '| sed -e "s/PHPSEARCH/<?php include \'search_functions.php\'; ?><?php search(); ?>/" > $TARGET',
+ 'rm -f ${TARGET}.tmp' ]))
+
<html>
<head>
<title>$title</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="../../doclib/senf.css" rel="stylesheet" type="text/css">
+<link href="@TOPDIR@/doc/html/doxygen.css" rel="stylesheet" type="text/css">
+<link href="@TOPDIR@/doclib/senf.css" rel="stylesheet" type="text/css">
<style type="text/css">
div.tabs ul li.$projectname a { background-color: #EDE497; }
</style>
<div id="head">
<div id="search">
- <form action="../../doclib/search.php" method="get">
+ <form action="@TOPDIR@/doclib/search.php" method="get">
Search: <input type="text" name="query" size="20" accesskey="s"/>
</form>
</div>
<div id="content2">
<div class="tabs menu">
<ul>
- <li class="Overview"><a href="../../doc/html/index.html">Overview</a></li>
- <li class="libSocket"><a href="../../Socket/doc/html/index.html">libSocket</a></li>
- <li class="libPackets"><a href="../../Packets/doc/html/index.html">libPackets</a></li>
- <li class="libScheduler"><a href="../../Scheduler/doc/html/index.html">libScheduler</a></li>
- <li class="libUtils"><a href="../../Utils/doc/html/index.html">libUtils</a></li>
- <li class="Examples"><a href="../../Examples/doc/html/index.html">Examples</a></li>
- <li class="SENFSCons"><a href="../../senfscons/doc/html/index.html">SENFSCons</a></li>
+ <li class="Overview"><a href="@TOPDIR@/doc/html/index.html">Overview</a></li>
+ <li class="libSocket"><a href="@TOPDIR@/Socket/doc/html/index.html">libSocket</a></li>
+ <li class="libPackets"><a href="@TOPDIR@/Packets/doc/html/index.html">libPackets</a></li>
+ <li class="libScheduler"><a href="@TOPDIR@/Scheduler/doc/html/index.html">libScheduler</a></li>
+ <li class="libPPI"><a href="@TOPDIR@/PPI/doc/html/index.html">libPPI</a></li>
+ <li class="libUtils"><a href="@TOPDIR@/Utils/doc/html/index.html">libUtils</a></li>
+ <li class="Examples"><a href="@TOPDIR@/Examples/doc/html/index.html">Examples</a></li>
+ <li class="SENFSCons"><a href="@TOPDIR@/senfscons/doc/html/index.html">SENFSCons</a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="xref.html">Open Issues</a></li>
- <li><a href="http://svn.berlios.de/wsvn/senf/?op=log&rev=0&sc=0&isdir=1">SVN ChangeLog</a></li>
- <li><a href="http://developer.berlios.de/projects/senf">SENF @ BerliOS</a></li>
- <li><a href="http://openfacts.berlios.de/index-en.phtml?title=SENF+Network+Framework">Wiki</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>
\ No newline at end of file
<html>
<head>
<title>$title</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
-<link href="../../../doclib/senf.css" rel="stylesheet" type="text/css">
+<link href="@TOPDIR@/doc/html/doxygen.css" rel="stylesheet" type="text/css">
+<link href="@TOPDIR@/doclib/senf.css" rel="stylesheet" type="text/css">
<style type="text/css">
div.tabs ul li.$projectname a { background-color: #EDE497; }
</style>
<div id="head">
<div id="search">
- <form action="../../../doclib/search.php" method="get">
+ <form action="@TOPDIR@/doclib/search.php" method="get">
Search: <input type="text" name="query" size="20" accesskey="s"/>
</form>
</div>
<div id="content2">
<div class="tabs menu">
<ul>
- <li class="Overview"><a href="../../../doc/html/index.html">Overview</a></li>
- <li class="libSocket"><a href="../../../Socket/doc/html/index.html">libSocket</a></li>
- <li class="libPackets"><a href="../../../Packets/doc/html/index.html">libPackets</a></li>
- <li class="libScheduler"><a href="../../../Scheduler/doc/html/index.html">libScheduler</a></li>
- <li class="libUtils"><a href="../../../Utils/doc/html/index.html">libUtils</a></li>
- <li class="Examples"><a href="../../../Examples/doc/html/index.html">Examples</a></li>
- <li class="SENFSCons"><a href="../../../senfscons/doc/html/index.html">SENFSCons</a></li>
+ <li class="Overview"><a href="@TOPDIR@/doc/html/index.html">Overview</a></li>
+ <li class="libSocket"><a href="@TOPDIR@/Socket/doc/html/index.html">libSocket</a></li>
+ <li class="libPackets"><a href="@TOPDIR@/Packets/doc/html/index.html">libPackets</a></li>
+ <li class="libScheduler"><a href="@TOPDIR@/Scheduler/doc/html/index.html">libScheduler</a></li>
+ <li class="libPPI"><a href="@TOPDIR@/PPI/doc/html/index.html">libPPI</a></li>
+ <li class="libUtils"><a href="@TOPDIR@/Utils/doc/html/index.html">libUtils</a></li>
+ <li class="Examples"><a href="@TOPDIR@/Examples/doc/html/index.html">Examples</a></li>
+ <li class="SENFSCons"><a href="@TOPDIR@/senfscons/doc/html/index.html">SENFSCons</a></li>
</ul>
</div>
encoding="html" \r
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"\r
doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>\r
+\r
+ <xsl:param name="topdir" select="''"/>\r
\r
<xsl:template match="*">\r
<xsl:copy>\r
- <xsl:for-each select="@*"><xsl:copy/></xsl:for-each>\r
+ <xsl:call-template name="copy-attributes"/>\r
<xsl:apply-templates/>\r
</xsl:copy>\r
</xsl:template>\r
\r
+ <xsl:template name="copy-attributes">\r
+ <xsl:for-each select="@*">\r
+ <xsl:attribute name="{name(current())}">\r
+ <xsl:choose>\r
+ <xsl:when test="contains(current(),'@TOPDIR@')">\r
+ <xsl:value-of select="substring-before(current(),'@TOPDIR@')"/>\r
+ <xsl:value-of select="$topdir"/>\r
+ <xsl:value-of select="substring-after(current(),'@TOPDIR@')"/>\r
+ </xsl:when>\r
+ <xsl:otherwise>\r
+ <xsl:value-of select="current()"/>\r
+ </xsl:otherwise>\r
+ </xsl:choose>\r
+ </xsl:attribute>\r
+ </xsl:for-each>\r
+ </xsl:template>\r
+ \r
<xsl:template match="li[form]"> \r
</xsl:template>\r
\r
+ <!-- Replace @TOPDIR@ with relative top directory path -->\r
+ <xsl:template match="@*[contains(current(),'@TOPDIR@')]">\r
+ <xsl:value-of select="substring-before(current(),'@TOPDIR')"/>\r
+ <xsl:value-of select="$topdir"/>\r
+ <xsl:value-of select="substring-after(current(),'@TOPDIR')"/>\r
+ </xsl:template>\r
+ \r
<!-- Add 'class' attribute to some special paragraphs/lists -->\r
\r
<xsl:template name="add-class">\r
<xsl:param name="class"/>\r
<xsl:copy>\r
- <xsl:for-each select="@*"><xsl:copy/></xsl:for-each>\r
+ <xsl:call-template name="copy-attributes"/>\r
<xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>\r
<xsl:apply-templates/>\r
</xsl:copy>\r
+++ /dev/null
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Search</title>
-<link href="../doc/html/doxygen.css" rel="stylesheet" type="text/css">
-<link href="senf.css" rel="stylesheet" type="text/css">
-<?php include 'search_functions.php'; ?>
-</head>
-<body>
-
-<div id="head">
- <div id="search">
- <form action="search.php" method="get">
- Search: <?php inputfield(); ?>
- </form>
- </div>
- <h1>SENF Extensible Network Framework</h1>
- <h2>Search Results</h2>
-</div>
-
-<div id="content1">
- <div id="content2">
- <div class="tabs menu">
- <ul>
- <li class="Overview"><a href="../doc/html/index.html">Overview</a></li>
- <li class="libSocket"><a href="../Socket/doc/html/index.html">libSocket</a></li>
- <li class="libPackets"><a href="../Packets/doc/html/index.html">libPackets</a></li>
- <li class="libScheduler"><a href="../Scheduler/doc/html/index.html">libScheduler</a></li>
- <li class="libUtils"><a href="../Utils/doc/html/index.html">libUtils</a></li>
- <li class="Examples"><a href="../Examples/doc/html/index.html">Examples</a></li>
- <li class="SENFSCons"><a href="../senfscons/doc/html/index.html">SENFSCons</a></li>
- </ul>
- </div>
-
- <div class="tabs">
- <ul>
- <li><a href="xref.html">Open Issues</a></li>
- <li><a href="http://svn.berlios.de/wsvn/senf/?op=log&rev=0&sc=0&isdir=1">SVN ChangeLog</a></li>
- <li><a href="http://developer.berlios.de/projects/senf">SENF @ BerliOS</a></li>
- <li><a href="http://openfacts.berlios.de/index-en.phtml?title=SENF+Network+Framework">Wiki</a></li>
- </ul>
- </div>
-
- <!-- Generated by Doxygen 1.4.7 -->
- <div class="tabs">
- <ul>
- <li><a href="index.html"><span>Main Page</span></a></li>
- <li><a href="pages.html"><span>Related Pages</span></a></li>
- <hr style="width:0px;border:none;clear:both;margin:0;padding:0" />
- </div>
-
- <?php search(); ?>
-
- <hr style="width:0px;border:none;clear:both;margin:0;padding:0" />
- </div>
-</div>
-<div id="footer">
- <span>
- <a href="mailto:senf-dev@lists.berlios.de">Contact: senf-dev@lists.berlios.de</a> |
- Copyright © 2006 Fraunhofer Gesellschaft, SatCom, Stefan Bund
- </span>
-</div>
-
-</body></html>
+<?php include '../doc/html/search_paths.php'; ?>
<?php
function search_results()
die("Error: PHP version 4.1.0 or above required!");
}
- $paths = array(
- "../doc/html/",
- "../Socket/doc/html/",
- "../Examples/doc/html/",
- "../Packets/doc/html/",
- "../Utils/doc/html/",
- "../Scheduler/doc/html/",
- );
+ $paths = paths();
$files = array();
$j=0;
for ($i=0; $i<sizeof($paths); $i++) {
out_dir = '.'
# add our output locations
+ html_dir = None
for (k, v) in output_formats.iteritems():
if data.get("GENERATE_" + k, v[0]).upper() == "YES":
dir = env.Dir( os.path.join(source[0].dir.abspath, out_dir, data.get(k + "_OUTPUT", v[1])) )
+ if k == "HTML" : html_dir = dir
dir.sources = source
node = env.File( os.path.join(dir.abspath, k.lower()+".stamp" ) )
targets.append(node)
if env.GetOption('clean'): targets.append(dir)
- if data.has_key("GENERATE_TAGFILE"):
+ if data.has_key("GENERATE_TAGFILE") and html_dir:
targets.append(env.File( os.path.join(source[0].dir.abspath, data["GENERATE_TAGFILE"]) ))
+ if data.get("SEARCHENGINE","NO").upper() == "YES":
+ targets.append(env.File( os.path.join(html_dir.abspath, "search.idx") ))
+
# don't clobber targets
for node in targets:
env.Precious(node)
if isinstance(doc,SCons.Node.FS.Dir): continue
if doc.name == 'xml.stamp' : xmlnode = doc
if doc.name == 'html.stamp' : htmlnode = doc
+ if doc.name == 'search.idx' : continue
if os.path.splitext(doc.name)[1] == '.stamp' : continue # ignore other file stamps
# otherwise it must be the tag file
tagnode = doc
if htmlnode and env.get('DOXY_HTML_XSL'):
xslfile = env.File(env['DOXY_HTML_XSL'])
+ reltopdir = '../' * len(htmlnode.dir.abspath[len(env.Dir('#').abspath)+1:].split('/'))
+ if reltopdir : reltopdir = reltopdir[:-1]
+ else : reltopdir = '.'
env.AddPostAction(
docs,
SCons.Action.Action(("for html in %s/*.html; do " +
" echo $$html;" +
" sed -e 's/id=\"current\"/class=\"current\"/' $${html}" +
" | tidy -ascii -q --show-warnings no --fix-uri no" +
- " | xsltproc --nonet --html -o $${html}.new %s - 2>&1" +
+ " | xsltproc --nonet --html --stringparam topdir %s -o $${html}.new %s - 2>&1" +
" | grep '^-'" +
" | grep -v 'ID .* already defined';" +
" mv $${html}.new $${html}; " +
"done")
- % (htmlnode.dir.abspath, xslfile.abspath)))
+ % (htmlnode.dir.abspath, reltopdir, xslfile.abspath)))
for doc in docs:
env.Depends(doc,xslfile)
env.Alias('all_docs',xref)
return xref
+
+def DoxySearch(env, docs=None):
+ if docs is None:
+ docs = env.Alias('all_docs')[0].sources
+ indices = [ doc for doc in docs if doc.name == "search.idx" ]
+ commands = [ "echo '<?php function paths() { return array(' >$TARGET" ]
+ root = env.Dir('#').abspath
+ commands.extend([ "echo '\"..%s/\",' >>$TARGET" % index.dir.abspath[len(root):]
+ for index in indices ])
+ commands.append("echo '); } ?>' >>$TARGET" )
+ target = env.Command("doc/html/search_paths.php", indices, commands)
+ env.Alias('all_docs', target)
+ return target
+
+
## \brief Build library
#
# This target helper will build the given library. The library will be