schema_salad.makedoc
Module Contents
Classes
Custom renderer with different representations of selected HTML tags. |
|
Functions
|
Remove the avro namespace, if any. |
|
|
|
|
|
Patches problematic Markdown lists for later HTML generation. |
|
Reverts fenced code fragments found in the modified contents back to their original definition. |
|
|
|
|
|
|
|
|
Build the argument parser. |
|
|
Shortcut entrypoint. |
|
Emit HTML representation of a given schema. |
Attributes
- schema_salad.makedoc.vocab_type_name(url)
Remove the avro namespace, if any.
- class schema_salad.makedoc.MyRenderer(escape=True, allow_harmful_protocols=None)
Bases:
digraph inheritanced9b3aab934 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BaseRenderer" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "HTMLRenderer" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "BaseRenderer" -> "HTMLRenderer" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MyRenderer" [URL="#schema_salad.makedoc.MyRenderer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Custom renderer with different representations of selected HTML tags."]; "HTMLRenderer" -> "MyRenderer" [arrowsize=0.5,style="setlinewidth(0.5)"]; }mistune.renderers.HTMLRenderer
Custom renderer with different representations of selected HTML tags.
- heading(text, level)
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.markdown_list_hook(markdown, text, state)
Patches problematic Markdown lists for later HTML generation.
When a Markdown list with paragraphs not indented with the list markers (no spaces before following lines),
mistune
v2 does not handle them correctly. This is however permitted as per https://daringfireball.net/projects/markdown/syntax#listFor example:
`markdown * some list * item with paragraph * other item `
Similarly, lists that are completely indented or that contains nested lists produce incorrect HTML
<p>
/<li>
tag combinations.Because list parsing is deeply nested within
mistune.block_parser.BlockParser
and that there is no easy way to override utility functions it employs to adjust patterns of list items without reimplementing it or a lot of monkey patching, instead catch the problem cases before rendering and adjust them with a hook.See https://github.com/lepture/mistune/issues/296 and https://github.com/common-workflow-language/schema_salad/pull/619
- 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.
- schema_salad.makedoc.basicTypes = ('https://w3id.org/cwl/salad#null', 'http://www.w3.org/2001/XMLSchema#boolean',...
- schema_salad.makedoc.number_headings(toc, maindoc)
- class schema_salad.makedoc.RenderType(toc, j, renderlist, redirects, primitiveType)
- Parameters:
- 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.