schema_salad.makedoc
Attributes
Pattern inspired from 'mistune.block_parser.BlockParser.FENCED_CODE'. |
|
Classes
Custom renderer with different representations of selected HTML tags. |
|
Functions
|
Escape HTML but otherwise preserve single quotes. |
|
Remove the avro namespace, if any. |
|
Retrieve all the types of a record. |
|
|
|
Reverts fenced code fragments found in the modified contents back to their original definition. |
|
|
|
|
|
Concatenate doc strings, replacing email addresses with mailto links. |
|
|
Build the argument parser. |
|
|
Shortcut entrypoint. |
|
Emit HTML representation of a given schema. |
Module Contents
- schema_salad.makedoc.PluginName
- schema_salad.makedoc.fenced_code_pattern: Final
Pattern inspired from ‘mistune.block_parser.BlockParser.FENCED_CODE’. However, instead of the initial ‘ {0,3}’ part to match any indented fenced-code, use any quantity of spaces, as long as they match at the end as well (using ‘’). Because of nested fenced-code in lists, it can be more indented than “normal”.
- schema_salad.makedoc.escape_html(s)
Escape HTML but otherwise preserve single quotes.
- schema_salad.makedoc.vocab_type_name(url)
Remove the avro namespace, if any.
- schema_salad.makedoc.has_types(items)
Retrieve all the types of a record.
- schema_salad.makedoc.markdown_plugins: Final[list[PluginName]] = ['strikethrough', 'footnotes', 'table', 'url']
- class schema_salad.makedoc.MyRenderer(escape=True, allow_harmful_protocols=None)
Bases:
mistune.renderers.html.HTMLRenderer
Custom renderer with different representations of selected HTML tags.
- heading(text, level, **attrs)
Override HTML heading creation with text IDs.
- inline_html(html)
Don’t escape characters in predefined HTML within paragraph tags.
- block_html(html)
Don’t escape characters nor wrap predefined HTML within paragraph tags.
- schema_salad.makedoc.patch_fenced_code(original_markdown_text, modified_markdown_text)
Reverts fenced code fragments found in the modified contents back to their original definition.
- class schema_salad.makedoc.ToC
- first_toc_entry = True
- numbering = [0]
- toc = ''
- start_numbering = True
- add_entry(thisdepth, title)
Add an entry to the table of contents.
- schema_salad.makedoc.basicTypes: Final = ('https://w3id.org/cwl/salad#null', 'http://www.w3.org/2001/XMLSchema#boolean',...
- schema_salad.makedoc.number_headings(toc, maindoc)
- schema_salad.makedoc.fix_doc(doc)
Concatenate doc strings, replacing email addresses with mailto links.
- class schema_salad.makedoc.RenderType(toc, j, renderlist, redirects, primitiveType)
- Parameters:
- typedoc
- toc: Final
- redirects: Final
- primitiveType: Final
- typefmt(tp, redirects, nbsp=False, jsonldPredicate=None)
- schema_salad.makedoc.avrold_doc(j, outdoc, renderlist, redirects, brand, brandlink, primtype, brandstyle=None, brandinverse=False)
- schema_salad.makedoc.arg_parser()
Build the argument parser.
- Return type:
- schema_salad.makedoc.main()
Shortcut entrypoint.
- Return type:
None
- schema_salad.makedoc.makedoc(stdout, schema, redirects=None, only=None, brand=None, brandlink=None, primtype=None, brandstyle=None, brandinverse=False)
Emit HTML representation of a given schema.