pyTRLCConverter.markdown.element

Markdown block elements. Each element renders itself into a Markdown string. Elements are collected by the MarkdownDocument and rendered once when the output file is written.

Author: Andreas Merkle (andreas.merkle@newtec.de)

Classes

BulletList

Unordered Markdown list block element.

Heading

Markdown heading block element.

Image

Markdown image / diagram link block element.

MarkdownElement

Abstract base class for Markdown block elements.

RawText

Raw Markdown text block element passed through unchanged.

Table

Markdown table block element.

Module Contents

class pyTRLCConverter.markdown.element.BulletList(values: List[str], escape: bool = True)[source]

Bases: MarkdownElement

Inheritance diagram of pyTRLCConverter.markdown.element.BulletList

Unordered Markdown list block element.

render() str[source]

Render the unordered list. The values will be automatically escaped for Markdown if necessary.

Returns:

Markdown list

Return type:

str

_escape = True
_values
class pyTRLCConverter.markdown.element.Heading(text: str, level: int, escape: bool = True)[source]

Bases: MarkdownElement

Inheritance diagram of pyTRLCConverter.markdown.element.Heading

Markdown heading block element.

render() str[source]

Render the heading. The text will be automatically escaped for Markdown if necessary.

Returns:

Markdown heading

Return type:

str

_escape = True
_level
_text
class pyTRLCConverter.markdown.element.Image(file_name: str, caption: str, escape: bool = True)[source]

Bases: MarkdownElement

Inheritance diagram of pyTRLCConverter.markdown.element.Image

Markdown image / diagram link block element.

render() str[source]

Render the image link. The caption will be automatically escaped for Markdown if necessary.

Returns:

Markdown diagram link

Return type:

str

_caption
_escape = True
_file_name
class pyTRLCConverter.markdown.element.MarkdownElement[source]

Bases: abc.ABC

Inheritance diagram of pyTRLCConverter.markdown.element.MarkdownElement

Abstract base class for Markdown block elements.

abstractmethod render() str[source]

Render the element into a Markdown string.

Returns:

Rendered Markdown

Return type:

str

class pyTRLCConverter.markdown.element.RawText(text: str)[source]

Bases: MarkdownElement

Inheritance diagram of pyTRLCConverter.markdown.element.RawText

Raw Markdown text block element passed through unchanged.

render() str[source]

Render the raw text.

Returns:

Raw Markdown text

Return type:

str

_text
class pyTRLCConverter.markdown.element.Table(column_titles: List[str], rows: List[List[str]])[source]

Bases: MarkdownElement

Inheritance diagram of pyTRLCConverter.markdown.element.Table

Markdown table block element. Rendered as HTML to support multi-line cells and other complex content.

render() str[source]

Render the table in HTML format.

Returns:

Markdown table

Return type:

str

_column_titles
_rows