Add .gitignore files
[senf.git] / doclib / SConscript
index cdb9cd6..ab5a009 100644 (file)
@@ -1,4 +1,124 @@
 # -*- python -*-
+#
+# The documentation generation process is tightly integrated with the
+# scons build framework:
+# 
+# * SCons analyzes the Doxyfile's to find all the documentation
+#   dependencies. This happens in the doxygen builder in
+#   senfscons/Doxygen.py.
+#
+# * the doclib/doxy-header.html and/or doclib/doxy-footer.html files
+#   are regenerated
+# 
+# * If any documentation is out-of-date with respect to it's source
+#   files, the documentation is regenerated.
+# 
+# * To fix some link errors, the additional 'linklint' and 'fixlinks'
+#   targets are used
+#
+# 
+# 1. Scanning the Doxyfile's
+# 
+# The doxygen builder scans all documentation source files which have
+# the text 'doxyfile' in any case in their name. It understands
+# @INCLUDE directives and will find all the dependencies of the
+# documentation:
+# 
+# * All the source files as selected by INPUT, INPUT_PATTERN,
+#   RECURSIVE and so on.
+# 
+# * Any referenced tag-files
+# 
+# * Documentation header and/or footer
+# 
+# * The INPUT_FILTER program
+# 
+# * Any included doxygen configuration files
+# 
+#
+# 2. Regenerating header and/or footer
+#
+# If needed, the doxy-header.html and/or doxy-footer.html file will be
+# regenerated. The dependencies are *not* complete, just adding a new
+# subdirectory sadly does not automatically update the header (which
+# contains the menu)
+#
+# The header and/or footer are written are generated from templates
+# using a simple python based templating system called yaptu which is
+# included in doclib/.
+#
+# 
+# 3. Calling doxygen
+# 
+# The doxygen call itself is quite complex since there is some pre-
+# and post-processing going on. We can separate this step into two
+# steps
+#
+# * Building prerequisites (e.g. images)
+#
+# * The processing done by the Doxygen builder and doclib/doxygen.sh
+#
+#
+# 3.1. Building prerequisites
+#
+# The prerequisites are images referenced by the documentation. These
+# images are mostly generated using the Dia2Png builder.
+#
+#
+# 3.2. The main doxygen build (Doxygen builder)
+#
+# The Doxygen builder will call the doxygen command to build the
+# documentation. 
+#
+# The doxygen command is configured as 'doclib/doxygen.sh' which
+# does some additional processing in addition to calling doxygen
+# proper
+#
+# * it sets environment variables depending on command line arguments.
+#   These variables are then used in the Doxyfile's
+#
+# * after doxygen is finished, 'installdox' is called to resolve 
+#   tag file references.
+#
+# * the HTML documentation is post-processed using some sed, tidy, and
+#   an XSLT template
+#
+# * a generated tag file is post-processed using an XSLT template
+#
+# (see doclib/doxygen.sh for more information). The Doxygen
+# configuration is set up such, that
+#
+# * doxygen calls 'doclib/filter.pl' on each source file. This filter
+#   will strip excess whitespace from the beginning of lines in
+#   '\code' and '<pre>' blocks. Additionally it will expand all tabs,
+#   tab width is 8 spaces (there should be no tabs in the source but
+#   ...)
+# 
+# * doxygen calls 'doclib/dot' to generate the 'dot' images.
+#
+# * 'doclib/dot' calls 'doclib/dot-munge.pl' on the .dot
+#    files. dot-munge.pl changes the font and font-size and adds
+#    line-breaks to long labels
+#
+# * 'doclib/dot' calls the real dot binary. If the resulting image is
+#   more than 800 pixels wide, dot is called again, this time using
+#   the oposite rank direction (top-bottom vs. left-right). The image
+#   with the smaller width is selected and returned.
+#
+#
+# 4. Fixing broken links
+#
+# After the documentation has been generated, additional calls first
+# to the 'linklint' and then to the 'fixlinks' target will try to fix
+# broken links generated by doxygen. First, 'linklint' will call the
+# linklint tool to check for broken links in the documentation.
+#
+# 'fixlinks' is then called which calls 'doclib/fixlinks.py' which
+# scans *all* html files, builds an index of all (unique) anchors and
+# then fixes the url part of all links with correct anchor but bad
+# file name.
+#
+
 
 Import('env')
 import SENFSCons
@@ -77,6 +197,7 @@ writeTemplate = env.Action(writeTemplate, varlist = [ 'TEMPLATE' ])
 EXTRA_MODULES = [
     ('Overview', '#/doc/html'),
     ('Examples', '#/Examples/doc/html'),
+    ('HowTos', '#/HowTos/doc/html'),
     ('SENFSCons', '#/senfscons/doc/html') ]
 
 HEADER = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
@@ -87,7 +208,7 @@ HEADER = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http
 <link href="@TOPDIR@/doclib/senf.css" rel="stylesheet" type="text/css">
 <link rel="shortcut icon" href="@TOPDIR@/doclib/favicon.ico">
 <style type="text/css">
-div.tabs ul li.$projectname a { background-color: #EDE497; }
+div.tabs li.$projectname a { background-color: #EDE497; }
 </style>
 </head>
 <body>
@@ -105,13 +226,15 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }
   </div>
   <div id="subtitle">
     <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>
       <li><a href="@TOPDIR@/doc/html/index.html">Home</a></li>
+      <li><a class="ext" href="http://satext.fokus.fraunhofer.de/senf/debian">Download</a></li>
+      <li><a class="ext" href="http://openfacts2.berlios.de/wikien/index.php/BerliosProject:SENF_Network_Framework">Wiki</a></li>
+      <li><a class="ext" href="http://developer.berlios.de/projects/senf">BerliOS</a></li>
+      <li><a class="ext" href="http://svn.berlios.de/wsvn/senf/?op=log&rev=0&sc=0&isdir=1">ChangeLog</a></li>
+      <li><a class="ext" href="http://svn.berlios.de/viewcvs/senf/trunk/">Browse SVN</a></li>
+      <li><a class="ext" href="http://developer.berlios.de/bugs/?group_id=7489">Bug Tracker</a></li>
+      <li><a href="@TOPDIR@/doc/html/xref.html">Open Issues</a></li>
     </ul>
-    <h2>${TITLE}</h2>
   </div>
 </div>
 
@@ -122,11 +245,10 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }
 {{      for name, path, level in modules():
           <li class="${name} level${level}"><a href="@TOPDIR@/${path}/index.html">${name}</a></li>
 }}
+        <li class="glossary level0"><a href="@TOPDIR@/doc/html/glossary.html">Glossary</a></li>
       </ul>
     </div>"""
 
-OVERVIEW_EXTRA_HEADER=""
-
 FOOTER = """<hr style="width:0px;border:none;clear:both;margin:0;padding:0" />
   </div>
 </div>
@@ -155,9 +277,6 @@ function paths() {
 env.Command('doxy-header.html', 'SConscript', writeTemplate,
             TEMPLATE = Literal(HEADER),
             TITLE = "Documentation and API reference")
-env.Command('doxy-header-overview.html', 'SConscript', writeTemplate,
-            TEMPLATE = Literal(HEADER+OVERVIEW_EXTRA_HEADER),
-            TITLE = "Introduction and Overview")
 env.Command('doxy-footer.html', 'SConscript', writeTemplate,
             TEMPLATE = Literal(FOOTER))
 env.Alias('all_docs',
@@ -171,7 +290,6 @@ env.Alias('all_docs',
                             +       "> ${TARGETS[0]}.tmp",
                         'mv ${TARGET}.tmp ${TARGET}' ],
                       TEMPLATE = Literal(HEADER
-                                         + OVERVIEW_EXTRA_HEADER
                                          + SEARCH_PHP.replace('<?','[[').replace('?>',']]')
                                          + FOOTER),
                       TITLE = "Search results"))
@@ -188,3 +306,4 @@ env.Alias('install_all',
                                                   'senf.css' ] ))
 
 env.Clean('all', 'doxy-header.html') # I should not need this but I do ...
+env.Clean('all_docs', 'doxy-header.html') # I should not need this but I do ...