oasislmf.utils.documentation.markdown

Classes

Module Contents

class oasislmf.utils.documentation.markdown.MarkdownGenerator[source]
sections = [][source]
get_markdown(generate_toc=False)[source]

Returns markdown string from joined self.sections

Parameters:

generate_toc (bool) – Generate table of contents bool.

Returns:

Markdown string

Return type:

str

generate_toc()[source]

Generate a table of contents from markdown string and prepend it to the sections.

add_header(title, level=1)[source]

Adds header to markdown

Parameters:
  • title (Any) – Title string

  • level (int) – Markdown header level. Defaults to 1.

add_definition(title, content)[source]

Adds definition line to markdown in the following format title: content

Parameters:
  • title (Any) – Name

  • content (Any) – Description

add_table(headers, rows)[source]

Adds a table to markdown with headers and rows

Parameters:
  • headers (List[str]) – Headers

  • rows (List[str]) – Rows

add_list(items)[source]

Adds list to markdown

Parameters:

items (List[str]) – List of items

add_collapsible_section(text, title='Root')[source]

Adds collapsible section to markdown

Parameters:
  • text (str) – contents of collapsible section

  • title (str, optional) – Collapsible section title text. Defaults to “Root”.

add_text(content)[source]

Adds text to markdown

Parameters:

content (Any) – Text content