X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=doclib%2FSConscript;h=bbb4ddee54b1393f9d0d8539e00b30aa97141296;hb=6f50bf49e282c0528f51faa0a245bbfa2b867399;hp=66c861936da577ea70b93c35520bd298ddf2f2f7;hpb=fe6f393c43f3e20607a06e2cc55eebb22b5ccfc8;p=senf.git diff --git a/doclib/SConscript b/doclib/SConscript index 66c8619..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,7 +77,8 @@ writeTemplate = env.Action(writeTemplate, varlist = [ 'TEMPLATE' ]) EXTRA_MODULES = [ ('Overview', '#/doc/html'), ('Examples', '#/Examples/doc/html'), - ('SenfScons', '#/senfscons/doc/html') ] + ('HowTos', '#/HowTos/doc/html'), + ('SENFSCons', '#/senfscons/doc/html') ] HEADER = """ @@ -45,39 +86,46 @@ HEADER = """ +