From c0bf14a6eb97af216cb12b05686a7ad7be697eeb Mon Sep 17 00:00:00 2001 From: s-ol Date: Mon, 16 Mar 2020 11:11:36 +0100 Subject: doc styling, preparation for internal md documentation --- docs/style.css | 11 +++ extra/docs.moon | 222 +++++++++++++++++++++++++++++------------------------- extra/layout.moon | 5 +- 3 files changed, 132 insertions(+), 106 deletions(-) diff --git a/docs/style.css b/docs/style.css index b9ef4a1..13f3c3b 100644 --- a/docs/style.css +++ b/docs/style.css @@ -147,3 +147,14 @@ a:hover code, .nest > p { margin: 0; } + +.ldoc h2 { + margin-bottom: 0; +} +.ldoc h3.indent { + margin: 0; + margin-left: 0.6rem; +} +.ldoc h3.indent + ul { + margin-top: 0; +} diff --git a/extra/docs.moon b/extra/docs.moon index ae59d6a..4bc4892 100644 --- a/extra/docs.moon +++ b/extra/docs.moon @@ -82,6 +82,7 @@ spit OUT, switch command layout style: '$(ldoc.css)' title: '$(ldoc.title)' + class: 'ldoc' preamble: ' # local iter = ldoc.modules.iter # local M = ldoc.markup @@ -94,8 +95,12 @@ spit OUT, switch command # if #ls > 1 then return "
  • ","
  • " else return "","" end # end # local base = module and "../../" or "../"' - body: ' -# if not module then + body: { + class: 'ldoc' + ' +# if ldoc.body then + $(ldoc.body) +# elseif not module then # if ldoc.description then

    $(M(ldoc.description))

    # end @@ -109,8 +114,12 @@ spit OUT, switch command @@ -130,123 +139,128 @@ spit OUT, switch command # end -

    index

    -# for kind, items in module.kinds() do -

    $(kind)

    - -# end -

    details

    -# for kind, items in module.kinds() do -

    $(kind)

    - # end - # end # end ' + } else error "unknown command '#{command}'" diff --git a/extra/layout.moon b/extra/layout.moon index 70d9848..2741a70 100644 --- a/extra/layout.moon +++ b/extra/layout.moon @@ -64,8 +64,10 @@ aopts = (href, pat) -> -- layout and write a doc page -- opts: +-- - preamble -- - title --- - body +-- - style +-- - body (str or table) layout = (opts) -> import header, footer, nav, div, span, b, code, a, article from require 'extra.dom' @@ -103,7 +105,6 @@ layout = (opts) -> #{title} - #{opts.css or ''} #{head} -- cgit v1.2.3