X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=doclib%2FSConscript;h=bbb4ddee54b1393f9d0d8539e00b30aa97141296;hb=6f50bf49e282c0528f51faa0a245bbfa2b867399;hp=61b7eba64372d5701bfa4a9aa5c390a4e89ec59b;hpb=c13146edc1b57cc60f102bcfd1a7a602ecec261f;p=senf.git diff --git a/doclib/SConscript b/doclib/SConscript index 61b7eba..bbb4dde 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 @@ -37,6 +77,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 = """ @@ -47,7 +88,7 @@ HEADER = """
@@ -66,8 +107,10 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }