From aedd7f485397b322fc88c60241fa1e5e684fd2b4 Mon Sep 17 00:00:00 2001 From: s-ol Date: Fri, 17 Apr 2020 16:08:45 +0200 Subject: move extra/ to docs/gen/ and split up --- docs/gen/ldoc | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100755 docs/gen/ldoc (limited to 'docs/gen/ldoc') diff --git a/docs/gen/ldoc b/docs/gen/ldoc new file mode 100755 index 0000000..b75740d --- /dev/null +++ b/docs/gen/ldoc @@ -0,0 +1,196 @@ +#!/usr/bin/env moon +import layout from require 'docs.gen.layout' + +export OUT, BASE + +spit = (file, str) -> + file = io.open file, 'w' + file\write str + file\close! + +{ OUT } = arg +BASE = '$(base)' + +spit OUT, layout + style: '$(ldoc.css)' + title: '$(ldoc.title)' + class: 'ldoc' + preamble: ' +# local iter = ldoc.modules.iter +# local M = ldoc.markup +# local function display_name(item) +# if item.type == "function" then +# return item.name:gsub(":new$", "")..item.args +# else return item.name end +# end +# local function use_li(ls) +# if #ls > 1 then return "
  • ","
  • " else return "","" end +# end +# local base = module and "../../" or "../"' + body: { + class: 'ldoc' + ' +# if ldoc.body then + $(ldoc.body) +# elseif not module then +# if ldoc.description then +

    $(M(ldoc.description))

    +# end +# if ldoc.full_description then +

    $(M(ldoc.full_description))

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

    $(kind)

    + +# end +# else +

    $(ldoc.module_typename(module):lower()) $(module.name)

    +

    $(M(module.summary, module))

    +

    $(M(module.description, module))

    + +# if module.see then +# local li,il = use_li(module.see) +

    see also:

    + +# end + +# if module.kinds()() then +

    index

    +# for kind, items in module.kinds() do +# kind = kind:lower() +

    $(kind)

    + +# end + +

    details

    +# for kind, items in module.kinds() do +# kind = kind:lower() +

    $(kind)

    + +# end +# end +# end +' + } -- cgit v1.2.3