diff options
author | Eduardo Julian | 2022-07-27 21:46:33 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-07-27 21:46:33 -0400 |
commit | ebfe1bbbe543299f8691e4862fbc899637ff8cfd (patch) | |
tree | 21c8142deb052fd17ef85809429b2fa41048f45d /stdlib/source/test | |
parent | 5da753fb0a4e220ea29fb3f45c92a69358901c20 (diff) |
New flat format for documentation fragments.
Diffstat (limited to 'stdlib/source/test')
-rw-r--r-- | stdlib/source/test/lux/documentation.lux | 84 |
1 files changed, 24 insertions, 60 deletions
diff --git a/stdlib/source/test/lux/documentation.lux b/stdlib/source/test/lux/documentation.lux index 53296522c..ce0832ed2 100644 --- a/stdlib/source/test/lux/documentation.lux +++ b/stdlib/source/test/lux/documentation.lux @@ -11,6 +11,7 @@ [format ["md" markdown]]] ["[0]" meta (.only) + ["[0]" symbol] ["[0]" code (.only) ["<[1]>" \\parser]] [macro @@ -38,70 +39,37 @@ (template.with_locals [g!default] (with_expansions ['definition_description' (..description) - 'sub_description' (..description) - 'super_description' (..description)] + 'module_description' (..description)] (these (def .public g!default Nat 123) - (def definition - (/.definition /.definition - 'definition_description')) - (def .public test Test (<| (_.covering /._) + (let [module (`` (/.module .._ + (,, (template.text ['module_description'])))) + definition (`` (/.definition (,, (template.symbol [.._] [g!default])) + 'definition_description'))]) (all _.and - (_.for [/.Definition] - (_.coverage [/.definition] - (and (case (`` (/.definition (,, (template.symbol [.._] [g!default])))) - (list definition) - (and (|> definition - (the /.#definition) - (text#= (template.text [g!default]))) - (|> definition - (the /.#documentation) - md.markdown - (text#= "") - not)) - - _ - false) - (case ..definition - (list documentation) - (and (|> documentation - (the /.#definition) - (text#= (template.text [/.definition]))) - (|> documentation - (the /.#documentation) - md.markdown - (text.contains? 'definition_description'))) - - _ - false)))) - (_.for [/.Module] - (_.coverage [/.module /.markdown] - (let [sub (`` (/.module /._ - (,, (template.text ['sub_description'])) - [] - [])) - super (`` (/.module .._ - (,, (template.text ['super_description'])) - [..definition] - [sub]))] - (and (text.contains? (template.text ['sub_description']) - (/.markdown sub)) - (text.contains? (/.markdown sub) - (/.markdown super)) - (text.contains? (template.text ['super_description']) - (/.markdown super)) - (case ..definition - (list documentation) - (text.contains? (md.markdown (the /.#documentation documentation)) - (/.markdown super)) - - _ - false))))) + (_.for [/.markdown] + (all _.and + (_.for [/.Module] + (_.coverage [/.module] + (and (let [[expected _] (symbol .._)] + (text.contains? expected + (/.markdown (list module)))) + (text.contains? (template.text ['module_description']) + (/.markdown (list module)))))) + (_.for [/.Definition] + (_.coverage [/.definition] + (and (text.contains? (template.text ['definition_description']) + (/.markdown (list module + definition))) + (text.contains? (template.text [g!default]) + (/.markdown (list module + definition)))))) + )) (_.coverage [/.unqualified_symbol] (`` (and (,, (with_template [<example>] [(macro_error <example>)] @@ -109,10 +77,6 @@ [(/.definition g!default)] [(/.definition g!default (,, (template.text ['definition_description'])))] - [(/.module g!default - "" - [..definition] - [sub])] ))))) ))))) ) |