schema_salad.makedoc

Attributes

PluginName

basicTypes

Classes

MyRenderer

Custom renderer with different representations of selected HTML tags.

ToC

RenderType

Functions

escape_html(s)

Escape HTML but otherwise preserve single quotes.

vocab_type_name(url)

Remove the avro namespace, if any.

has_types(items)

linkto(item)

patch_fenced_code(original_markdown_text, ...)

Reverts fenced code fragments found in the modified contents back to their original definition.

to_id(text)

number_headings(toc, maindoc)

fix_doc(doc)

avrold_doc(j, outdoc, renderlist, redirects, brand, ...)

arg_parser()

Build the argument parser.

main()

Shortcut entrypoint.

makedoc(stdout, schema[, redirects, only, brand, ...])

Emit HTML representation of a given schema.

Module Contents

schema_salad.makedoc.PluginName
schema_salad.makedoc.escape_html(s)

Escape HTML but otherwise preserve single quotes.

Parameters:

s (str)

Return type:

str

schema_salad.makedoc.vocab_type_name(url)

Remove the avro namespace, if any.

Parameters:

url (str)

Return type:

str

schema_salad.makedoc.has_types(items)
Parameters:

items (Any)

Return type:

List[str]

schema_salad.makedoc.linkto(item)
Parameters:

item (str)

Return type:

str

class schema_salad.makedoc.MyRenderer(escape=True, allow_harmful_protocols=None)

Bases: mistune.renderers.html.HTMLRenderer

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",tooltip="A renderer for converting Markdown to HTML."]; "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)"]; }

Custom renderer with different representations of selected HTML tags.

heading(text, level, **attrs)

Override HTML heading creation with text IDs.

Parameters:
  • text (str)

  • level (int)

  • attrs (Any)

Return type:

str

text(text)

Don’t escape quotation marks.

Parameters:

text (str)

Return type:

str

inline_html(html)

Don’t escape characters in predefined HTML within paragraph tags.

Parameters:

html (str)

Return type:

str

block_html(html)

Don’t escape characters nor wrap predefined HTML within paragraph tags.

Parameters:

html (str)

Return type:

str

block_code(code, info=None)

Don’t escape quotation marks.

Parameters:
  • code (str)

  • info (Optional[str])

Return type:

str

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.

Parameters:
  • original_markdown_text (str)

  • modified_markdown_text (str)

Return type:

str

schema_salad.makedoc.to_id(text)
Parameters:

text (str)

Return type:

str

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.

Parameters:
Return type:

str

contents(idn)
Parameters:

idn (str)

Return type:

str

schema_salad.makedoc.basicTypes = ('https://w3id.org/cwl/salad#null', 'http://www.w3.org/2001/XMLSchema#boolean',...
schema_salad.makedoc.number_headings(toc, maindoc)
Parameters:
Return type:

str

schema_salad.makedoc.fix_doc(doc)
Parameters:

doc (Union[List[str], str])

Return type:

str

class schema_salad.makedoc.RenderType(toc, j, renderlist, redirects, primitiveType)
Parameters:
  • toc (ToC)

  • j (List[Dict[str, Any]])

  • renderlist (List[str])

  • redirects (Dict[str, str])

  • primitiveType (str)

typedoc
toc
subs: Dict[str, str]
docParent: Dict[str, List[str]]
docAfter: Dict[str, List[str]]
rendered: Set[str]
redirects
title: str | None = None
primitiveType
metaschema_loader
alltypes
typemap: Dict[str, Dict[str, str]]
uses: Dict[str, List[Tuple[str, str]]]
record_refs: Dict[str, List[str]]
typefmt(tp, redirects, nbsp=False, jsonldPredicate=None)
Parameters:
  • tp (Any)

  • redirects (Dict[str, str])

  • nbsp (bool)

  • jsonldPredicate (Optional[Union[Dict[str, str], str]])

Return type:

str

render_type(f, depth)
Parameters:
  • f (Dict[str, Any])

  • depth (int)

Return type:

None

schema_salad.makedoc.avrold_doc(j, outdoc, renderlist, redirects, brand, brandlink, primtype, brandstyle=None, brandinverse=False)
Parameters:
  • j (List[Dict[str, Any]])

  • outdoc (IO[Any])

  • renderlist (List[str])

  • redirects (Dict[str, str])

  • brand (str)

  • brandlink (str)

  • primtype (str)

  • brandstyle (Optional[str])

  • brandinverse (Optional[bool])

Return type:

None

schema_salad.makedoc.arg_parser()

Build the argument parser.

Return type:

argparse.ArgumentParser

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.

Parameters:
  • stdout (IO[Any])

  • schema (str)

  • redirects (Optional[List[str]])

  • only (Optional[List[str]])

  • brand (Optional[str])

  • brandlink (Optional[str])

  • primtype (Optional[str])

  • brandstyle (Optional[str])

  • brandinverse (Optional[bool])

Return type:

None