From 53364ddc2e09362cb17432abf4fb598557554a9f Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 30 Oct 2021 11:42:13 +0800 Subject: + LDoc --- Data/Libraries/LDoc/tests/example/style/ldoc.ltp | 135 +++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 Data/Libraries/LDoc/tests/example/style/ldoc.ltp (limited to 'Data/Libraries/LDoc/tests/example/style/ldoc.ltp') diff --git a/Data/Libraries/LDoc/tests/example/style/ldoc.ltp b/Data/Libraries/LDoc/tests/example/style/ldoc.ltp new file mode 100644 index 0000000..24d786a --- /dev/null +++ b/Data/Libraries/LDoc/tests/example/style/ldoc.ltp @@ -0,0 +1,135 @@ + + + + + $(ldoc.title) + + + + +
+ +
+ +
+
+
+ +
+ +# local iter = ldoc.modules.iter +# local M = ldoc.markup + + + +# local function no_spaces(s) return s:gsub('%s','_') end +# 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 + + + + +
    + +# if module then + +

    Module $(module.name)

    + +

    $(M(module.summary))

    +

    $(M(module.description))

    + +
    +
    + +# --- currently works for both Functions and Tables. The params field either contains +# --- function parameters or table fields. +# for kind, items in module.kinds() do +
    +# for item in items() do +
    + + $(display_name(item)) +
    +
    + $(M(item.summary)) + $(M(item.description)) + +# 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.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 + +
    +
    +
    +
    +
    + + + -- cgit v1.1-26-g67d0