# 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) | Retrieve all the types of a record.
`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) | Concatenate doc strings, replacing email addresses with mailto links.
`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)

  Retrieve all the types of a record.

  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`

  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:

      - thisdepth (int)

      - title (str)

    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:

    - toc (ToC)

    - maindoc (str)

  Return type:

    str

schema_salad.makedoc.fix_doc(doc)

  Concatenate doc strings, replacing email addresses with mailto links.

  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
  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)

    Render a type declaration.

    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