예제 #1
0
파일: library.py 프로젝트: rhuygen/mkapi
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()
예제 #2
0
def d():
    return mkapi.get_node(D)
예제 #3
0
def c():
    return mkapi.get_node(C)
예제 #4
0
def b():
    return mkapi.get_node(B)
예제 #5
0
def a():
    return mkapi.get_node(A)
예제 #6
0
파일: library.py 프로젝트: rhuygen/mkapi
        """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