X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=doclib%2FSConscript;h=a16273141d9ca8b513a901e79939dc1d86b73b7b;hb=ae06fe86f16fdabb7ffb219d255444d2eb4f4f79;hp=5ade4e5fc8f4d45ac8888e92106c700b4ba15290;hpb=a358b3d4a24bfe1058cb79cf3e80d9a88e23b10f;p=senf.git diff --git a/doclib/SConscript b/doclib/SConscript index 5ade4e5..a162731 100644 --- a/doclib/SConscript +++ b/doclib/SConscript @@ -8,16 +8,56 @@ import SENFSCons import yaptu def modules(): + # Naja ... etwas rumgehackt aber was solls ... global EXTRA_MODULES - rv = [] - ix = len(env.Dir('#').abspath)+1 - ex = dict((env.Dir(p).abspath,True) for n,p in EXTRA_MODULES) + mods = {} + 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): - rv.append(('lib%s' % module.dir.dir.dir.name, module.dir.abspath[ix:])) - rv.sort() - return [ (name, env.Dir(path).abspath[ix:]) for name,path in EXTRA_MODULES ] + rv + 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 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: + i += 1 + rv[i:i] = [ mod ] + mods[mod][2] = level + break + i += 1 + if i == len(rv): + rv.append(mod) + + 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 @@ -69,6 +109,7 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }
  • SVN ChangeLog
  • SENF @ BerliOS
  • Wiki
  • +
  • Home
  • ${TITLE}

    @@ -78,8 +119,8 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }
    """ @@ -111,23 +152,23 @@ function paths() { } ?>""" -env.Command('doxy-header.html', None, writeTemplate, +env.Command('doxy-header.html', 'SConscript', writeTemplate, TEMPLATE = Literal(HEADER), TITLE = "Documentation and API reference") -env.Command('doxy-header-overview.html', None, writeTemplate, +env.Command('doxy-header-overview.html', 'SConscript', writeTemplate, TEMPLATE = Literal(HEADER+OVERVIEW_EXTRA_HEADER), TITLE = "Introduction and Overview") -env.Command('doxy-footer.html', None, writeTemplate, +env.Command('doxy-footer.html', 'SConscript', writeTemplate, TEMPLATE = Literal(FOOTER)) env.Alias('all_docs', - env.Command('search.php', 'html-munge.xsl', + env.Command('search.php', [ 'html-munge.xsl', 'SConscript' ], [ writeTemplate, 'xsltproc --nonet --html --stringparam topdir .. -o - $SOURCE $TARGET 2>/dev/null' + "| sed" + r" -e 's/\[\[//g'" + r" -e 's/\$$projectname/Overview/g'" + r" -e 's/\$$title/Search results/g'" - + "> ${TARGET}.tmp", + + "> ${TARGETS[0]}.tmp", 'mv ${TARGET}.tmp ${TARGET}' ], TEMPLATE = Literal(HEADER + OVERVIEW_EXTRA_HEADER @@ -135,5 +176,16 @@ env.Alias('all_docs', + FOOTER), TITLE = "Search results")) env.Alias('all_docs', - env.Command('search_paths.php', None, writeTemplate, + 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 ...