From 74455c089aee53612f46300784836136b61253fd Mon Sep 17 00:00:00 2001 From: steve donovan Date: Mon, 6 Jun 2011 18:35:23 +0200 Subject: [PATCH] changes in templates required for supporting Sections --- ldoc.ltp | 355 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 185 insertions(+), 170 deletions(-) diff --git a/ldoc.ltp b/ldoc.ltp index 60e2249..6e6103f 100644 --- a/ldoc.ltp +++ b/ldoc.ltp @@ -1,170 +1,185 @@ - - - - $(ldoc.title) - - - - -
- -
- -
-
-
- -
- -# local iter = ldoc.modules.iter -# local M = ldoc.markup - - - - - -
- -# if module then - -

Module $(module.name)

- -# local function use_li(ls) -# if #ls > 1 then return '
  • ','
  • ' else return '','' end -# end -# local function display_name(item) -# if item.type == 'function' then return item.name..' '..item.args -# else return item.name end -# end - -

    $(M(module.summary))

    -

    $(M(module.description))

    - -## -- bang out the tables of item types for this module (e.g Functions, Tables, etc) -# for kind,items in module.kinds() do -

    $(kind)

    - -# for item in items() do - - - - -# end -- for items -
    $(display_name(item))$(M(item.summary))
    -#end -- for kinds - -
    -
    - -# --- currently works for both Functions and Tables. The params field either contains -# --- function parameters or table fields. -# for kind, items, type in module.kinds() do -

    $(kind)

    -
    -# for item in items() do -
    - - $(display_name(item)) -
    -
    - $(M(item.summary)) - $(M(item.description)) - -# if item.params and #item.params > 0 then -

    $(type.subnames):

    -
      -# for p in iter(item.params) do -
    • $(p): $(M(item.params[p]))
    • -# end -- for -
    -# end -- if params - -# if item.usage then -# local li,il = use_li(item.usage) -

    Usage:

    -
      -# for usage in iter(item.usage) do - $(li)
      $(usage)
      $(il) -# end -- for -
    -# end -- if usage - -# if item.ret then -# local li,il = use_li(item.ret) -

    Returns:

    -
      -# for r in iter(item.ret) do - $(li)$(M(r))$(il) -# end -- for -
    -# end -- if returns - -# if item.see then -# local li,il = use_li(item.see) -

    see also:

    -
      -# for see in iter(item.see) do - $(li)$(see.label)$(il) -# end -- for -
    -# end -- if see -
    -# end -- for items -
    -# end -- for kinds - -# else -- if module - -# if ldoc.description then -

    $(M(ldoc.description))

    -# end - -# for kind, mods, type in ldoc.kinds() do -

    $(kind)

    -# kind = kind:lower() -# for m in mods() do - - - - - -# end -- for modules -
    $(m.name)$(M(m.summary))
    -# end -- for kinds -# end -- if module - -
    -
    -
    -
    -
    - - - + + + + $(ldoc.title) + + + + +
    + +
    + +
    +
    +
    + +
    + +# local iter = ldoc.modules.iter +# local M = ldoc.markup + + + +# local function no_spaces(s) return s:gsub('%s','_') end + + + +
    + +# if module then + +

    Module $(module.name)

    + +# local function use_li(ls) +# if #ls > 1 then return '
  • ','
  • ' else return '','' end +# end +# local function display_name(item) +# if item.type == 'function' then return item.name..' '..item.args +# else return item.name end +# end + +

    $(M(module.summary))

    +

    $(M(module.description))

    + +# -- bang out the tables of item types for this module (e.g Functions, Tables, etc) +# for kind,items in module.kinds() do +

    $(kind)

    + +# for item in items() do + + + + +# end -- for items +
    $(display_name(item))$(M(item.summary))
    +#end -- for kinds + +
    +
    + +# --- currently works for both Functions and Tables. The params field either contains +# --- function parameters or table fields. +# for kind, items in module.kinds() do +

    $(kind)

    +
    +# for item in items() do +
    + + $(display_name(item)) +
    +
    + $(M(item.summary)) + $(M(item.description)) + +# if item.params and #item.params > 0 then +

    $(module.kinds:type_of(item).subnames):

    +
      +# for p in iter(item.params) do +
    • $(p): $(M(item.params[p]))
    • +# end -- for +
    +# end -- if params + +# if item.usage then +# local li,il = use_li(item.usage) +

    Usage:

    +
      +# for usage in iter(item.usage) do + $(li)
      $(usage)
      $(il) +# end -- for +
    +# end -- if usage + +# if item.ret then +# local li,il = use_li(item.ret) +

    Returns:

    +
      +# for r in iter(item.ret) do + $(li)$(M(r))$(il) +# end -- for +
    +# end -- if returns + +# if item.see then +# local li,il = use_li(item.see) +

    see also:

    +
      +# for see in iter(item.see) do + $(li)$(see.label)$(il) +# end -- for +
    +# end -- if see +
    +# end -- for items +
    +# end -- for kinds + +# else -- if module + +# if ldoc.description then +

    $(M(ldoc.description))

    +# end + +# for kind, mods in ldoc.kinds() do +

    $(kind)

    +# kind = kind:lower() +# for m in mods() do + + + + + +# end -- for modules +
    $(m.name)$(M(m.summary))
    +# end -- for kinds +# end -- if module + +
    +
    +
    +
    +
    + + +