schema_salad.makedoc
====================

.. py:module:: schema_salad.makedoc


Attributes
----------

.. autoapisummary::

   schema_salad.makedoc.PluginName
   schema_salad.makedoc.fenced_code_pattern
   schema_salad.makedoc.markdown_plugins
   schema_salad.makedoc.basicTypes


Classes
-------

.. autoapisummary::

   schema_salad.makedoc.MyRenderer
   schema_salad.makedoc.ToC
   schema_salad.makedoc.RenderType


Functions
---------

.. autoapisummary::

   schema_salad.makedoc.escape_html
   schema_salad.makedoc.vocab_type_name
   schema_salad.makedoc.has_types
   schema_salad.makedoc.linkto
   schema_salad.makedoc.patch_fenced_code
   schema_salad.makedoc.to_id
   schema_salad.makedoc.number_headings
   schema_salad.makedoc.fix_doc
   schema_salad.makedoc.avrold_doc
   schema_salad.makedoc.arg_parser
   schema_salad.makedoc.main
   schema_salad.makedoc.makedoc


Module Contents
---------------

.. py:data:: PluginName

.. py:data:: fenced_code_pattern
   :type:  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".


.. py:function:: escape_html(s)

   Escape HTML but otherwise preserve single quotes.


.. py:function:: vocab_type_name(url)

   Remove the avro namespace, if any.


.. py:function:: has_types(items)

   Retrieve all the types of a record.


.. py:function:: linkto(item)

.. py:data:: markdown_plugins
   :type:  Final[list[PluginName]]
   :value: ['strikethrough', 'footnotes', 'table', 'url']


.. py:class:: MyRenderer(escape = True, allow_harmful_protocols = None)

   Bases: :py:obj:`mistune.renderers.html.HTMLRenderer`

   .. autoapi-inheritance-diagram:: schema_salad.makedoc.MyRenderer
      :parts: 1


   Custom renderer with different representations of selected HTML tags.


   .. py:method:: heading(text, level, **attrs)

      Override HTML heading creation with text IDs.



   .. py:method:: text(text)

      Don't escape quotation marks.



   .. py:method:: inline_html(html)

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



   .. py:method:: block_html(html)

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



   .. py:method:: block_code(code, info = None)

      Don't escape quotation marks.



.. py:function:: patch_fenced_code(original_markdown_text, modified_markdown_text)

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


.. py:function:: to_id(text)

.. py:class:: ToC

   .. py:attribute:: first_toc_entry
      :value: True



   .. py:attribute:: numbering
      :value: [0]



   .. py:attribute:: toc
      :value: ''



   .. py:attribute:: start_numbering
      :value: True



   .. py:method:: add_entry(thisdepth, title)

      Add an entry to the table of contents.



   .. py:method:: contents(idn)


.. py:data:: basicTypes
   :type:  Final
   :value: ('https://w3id.org/cwl/salad#null', 'http://www.w3.org/2001/XMLSchema#boolean',...


.. py:function:: number_headings(toc, maindoc)

.. py:function:: fix_doc(doc)

   Concatenate doc strings, replacing email addresses with mailto links.


.. py:class:: RenderType(toc, j, renderlist, redirects, primitiveType)

   .. py:attribute:: typedoc


   .. py:attribute:: toc
      :type:  Final


   .. py:attribute:: subs
      :type:  Final[dict[str, str]]


   .. py:attribute:: docParent
      :type:  Final[dict[str, list[str]]]


   .. py:attribute:: docAfter
      :type:  Final[dict[str, list[str]]]


   .. py:attribute:: rendered
      :type:  Final[set[str]]


   .. py:attribute:: redirects
      :type:  Final


   .. py:attribute:: title
      :type:  str | None
      :value: None



   .. py:attribute:: primitiveType
      :type:  Final


   .. py:attribute:: typemap
      :type:  Final[dict[str, dict[str, str]]]


   .. py:attribute:: uses
      :type:  Final[dict[str, list[tuple[str, str]]]]


   .. py:attribute:: record_refs
      :type:  Final[dict[str, list[str]]]


   .. py:method:: typefmt(tp, redirects, nbsp = False, jsonldPredicate = None)


   .. py:method:: render_type(f, depth)

      Render a type declaration.



.. py:function:: avrold_doc(j, outdoc, renderlist, redirects, brand, brandlink, primtype, brandstyle = None, brandinverse = False)

.. py:function:: arg_parser()

   Build the argument parser.


.. py:function:: main()

   Shortcut entrypoint.


.. py:function:: makedoc(stdout, schema, redirects = None, only = None, brand = None, brandlink = None, primtype = None, brandstyle = None, brandinverse = False)

   Emit HTML representation of a given schema.


