From 25f4cfcb055c3ea96f4940d2be39039c6e662023 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 29 Mar 2021 00:40:16 -0700 Subject: [PATCH] doc(ltp): Implement module `extra-header` section Co-authored-by: Lucas Schwiderski Co-authored-by: Aire-One --- docs/ldoc.css | 14 +++++++++++ docs/ldoc.ltp | 68 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/docs/ldoc.css b/docs/ldoc.css index b2a22f3b..f429dcdd 100644 --- a/docs/ldoc.css +++ b/docs/ldoc.css @@ -509,6 +509,10 @@ pre .url { color: #272fc2; text-decoration: underline; } list-style: none; } +.inheritance .inheritance__level--root { + padding-left: 0; +} + .inheritance .inheritance__level__node::before { content: "↳"; } @@ -518,3 +522,13 @@ pre .url { color: #272fc2; text-decoration: underline; } content: " "; white-space: pre; } + +.extra-header { + display: flex; + flex-direction: row; + flex-wrap: wrap; +} + +.extra-header__section { + flex-grow: 1; +} diff --git a/docs/ldoc.ltp b/docs/ldoc.ltp index 337dba60..06d4587f 100644 --- a/docs/ldoc.ltp +++ b/docs/ldoc.ltp @@ -184,17 +184,24 @@

Module: $(module.name)

$(M(module.summary,module))

$(M(module.description,module))

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

Usage:

+
    +# for usage in iter(module.usage) do + $(li)
    $(ldoc.escape(usage))
    $(il) +# end -- for +
+# end -- if usage +
# if module.tags.supermodule or module.tags.knownusage then +

Class Hierarchy

# local function draw_hierary_recursifly(i) -
    -# if i == #hierarchy then -
  • -# else -
  • -# end +# local is_root_level = (i == #hierarchy) +
      +
    • # local mod = hierarchy[i] # local name = display_name(hierarchy[i]) # if mod == module then @@ -209,7 +216,7 @@
    • # end
    -# end +# end -- module.tags.supermodule # draw_hierary_recursifly(#hierarchy)
# end @@ -217,32 +224,37 @@ # if module.tags.include then $(M(ldoc.include_file(module.tags.include))) # end -# if module.see then -# local li,il = use_li(module.see) -

See also:

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

Usage:

-
    -# for usage in iter(module.usage) do - $(li)
    $(ldoc.escape(usage))
    $(il) -# end -- for -
-# end -- if usage +
# if module.info then +

Info:

    # for tag, value in module.info:iter() do -
  • $(tag): $(M(value,module))
  • +
  • $(tag): $(M(value,module))
  • # end
+
# end -- if module.info +# if module.see then +
+# local li,il = use_li(module.see) +

See also:

+# if #module.see > 1 then +
    +# else +

    +# end +# for see in iter(module.see) do + $(li)$(see.label)$(il) +# end -- for +# if #module.see > 1 then +

+# else +

+# end +
+# end -- if see +
# if not ldoc.no_summary then @@ -275,7 +287,7 @@ # end $(M(item.summary,item)) # if inherited then - + Inherited from $(item.baseclass) # end