Ejemplo n.º 1
0
def get_html(obj) -> str:
    # Construct a node tree structure.
    node = mkapi.get_node(obj)

    # Create a joint Markdown from components of the node.
    markdown = node.get_markdown()

    # Convert it into HTML by any external converter.
    html = converter.convert(markdown)

    # Split and distribute the HTML into original components.
    node.set_html(html)

    # Render the node to create final HTML.
    return node.render()
Ejemplo n.º 2
0
def d():
    return mkapi.get_node(D)
Ejemplo n.º 3
0
def c():
    return mkapi.get_node(C)
Ejemplo n.º 4
0
def b():
    return mkapi.get_node(B)
Ejemplo n.º 5
0
def a():
    return mkapi.get_node(A)
Ejemplo n.º 6
0
        """Init docstring."""
        self.a: int = 1  #: Integer **attribute**.

    def to_str(self, x: int) -> str:
        """Converts `int` to `str`.

        Args:
            x: Input **value**.
        """
        return str(x)


# `mkapi.get_node()` generates a `Node` object that has tree structure.

# -
node = mkapi.get_node(A)
type(node)

# Some attributes:

node.object.kind, node.object.name
# -
docstring = node.docstring
len(docstring.sections)  # type:ignore
# -
section = docstring.sections[0]  # type:ignore
section.name, section.markdown
# -
section = docstring.sections[1]  # type:ignore
section.name, section.markdown