Started a glossary implementation (initialized from the socket lib glossary) in Gloss...
[senf.git] / doclib / SConscript
index e72656b..a9d17ec 100644 (file)
@@ -11,19 +11,20 @@ def modules():
     # Naja ... etwas rumgehackt aber was solls ...
     global EXTRA_MODULES
     mods = {}
-    ix = len(env.Dir('#').abspath)+1
-    ex = dict((env.Dir(p).abspath,True) for n,p in EXTRA_MODULES)
+    pathbase = len(env.Dir('#').abspath)+1
     for module in env.Alias('all_docs')[0].sources:
         if module.name != 'html.stamp' : continue 
-        if not ex.get(module.dir.abspath):
-            mods[module.dir.dir.dir.abspath] = [ module.dir.dir.dir.name, module.dir.abspath[ix:], 0 ]
+        mods[module.dir.dir.dir.abspath] = [ module.dir.dir.dir.name,
+                                             module.dir.abspath[pathbase:],
+                                             0 ]
+        
     rv = []
     keys = mods.keys()
     keys.sort()
     for mod in keys:
         i = 0
         while i < len(rv):
-            if mod.startswith(rv[i] + '/'):
+            if len(rv[i]) > pathbase and mod.startswith(rv[i] + '/'):
                 level = mods[rv[i]][2] + 1
                 i += 1
                 while i < len(rv) and mods[rv[i]][2] >= level:
@@ -34,11 +35,29 @@ def modules():
             i += 1
         if i == len(rv):
             rv.append(mod)
-    return [ (name, env.Dir(path).abspath[ix:], 0) for name,path in EXTRA_MODULES
-             ] + [ ( (((not mods[mod][2]) and 'lib') or '') + mods[mod][0],
-                     mods[mod][1],
-                     mods[mod][2])
-                   for mod in rv ]
+
+    for mod in keys:
+        if mods[mod][2] == 0:
+            mods[mod][0] = 'lib' + mods[mod][0]
+
+    n = 0
+    for name,path in EXTRA_MODULES:
+        path = env.Dir(path).dir.dir.abspath
+        i = 0
+        while i < len(rv):
+            if rv[i] == path:
+                mods[rv[i]][0] = name
+                m = 1
+                while i+m < len(rv) and mods[rv[i+m]][2] > mods[rv[i]][2]:
+                    m += 1
+                rv[n:n] = rv[i:i+m]
+                rv[i+m:i+2*m] = []
+                i += m
+                n += m
+            else:
+                i += 1
+
+    return ( tuple(mods[mod]) for mod in rv )
 
 def indices():
     ix = len(env.Dir('#').abspath)+1
@@ -58,6 +77,7 @@ writeTemplate = env.Action(writeTemplate, varlist = [ 'TEMPLATE' ])
 EXTRA_MODULES = [
     ('Overview', '#/doc/html'),
     ('Examples', '#/Examples/doc/html'),
+    ('HowTo\'s', '#/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">
@@ -68,7 +88,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>
@@ -87,8 +107,10 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }
   <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://developer.berlios.de/bugs/?group_id=7489">Bug Tracker</a></li>
+      <li><a class="ext" href="http://svn.berlios.de/viewcvs/senf/trunk/">Browse SVN</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://developer.berlios.de/projects/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>
     </ul>
@@ -103,11 +125,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>
@@ -136,9 +157,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',
@@ -152,10 +170,20 @@ 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"))
 env.Alias('all_docs',
           env.Command('search_paths.php', 'SConscript', writeTemplate,
                       TEMPLATE = Literal(SEARCH_PATHS_PHP)))
+
+env.Alias('install_all',
+          env.Install( '$DOCINSTALLDIR/doclib', [ 'favicon.ico',
+                                                  'logo-head.png',
+                                                  'search.php',
+                                                  'search_functions.php',
+                                                  'search_paths.php',
+                                                  '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 ...