docs

classdocs.cls_sig

Generate a class signature string.

1
2
3
4
class cls_sig:
    """Generate a class signature string."""
    n: Node  # the node to generate signature for
    dataclass = False  # whether to include @dataclass decorator
funcdocs.fn_sig

Generate a function signature string with inline parameter documentation.

1
2
3
4
5
def fn_sig(
    n: Node,  # the node to generate signature for
    is_async=False  # async ?
) -> str:
    """Generate a function signature string with inline parameter documentation."""
classdocs.sig

Generate a signature string for a class or function node.

1
2
3
class sig:
    """Generate a signature string for a class or function node."""
    n: Node  # the node to generate signature for
funcdocs.write_llms

Write API signatures to llms.txt file for LLM consumption.

1
2
3
4
5
6
def write_llms(
    meta: dict,  # project metadata from pyproject.toml
    nodes: list,  # list of Node objects to document
    root: str='.'  # root directory containing pyproject.toml
):
    """Write API signatures to llms.txt file for LLM consumption."""
funcdocs.render_node

Builds a `node` for docs

1
2
3
4
5
6
def render_node(
    n,
    repo_url=None,
    root='.'
):
    """Builds a `node` for docs"""
funcdocs.render_module_page

Builds a Module Page

1
2
3
4
5
6
7
8
def render_module_page(
    mod_name,
    mod_nodes,
    all_mod_names,
    meta,
    root='.'
):
    """Builds a Module Page"""
funcdocs.build_docs

Builds the static documentation website

1
2
3
4
def build_docs(
    root='.'  # the project root (this should never really change)
):
    """Builds the static documentation website"""
funcdocs.html_preview

Display FT components in an IFrame

1
2
3
4
5
def html_preview(
    width='100%',
    height='300px'
):
    """Display FT components in an IFrame"""
funcdocs.Icon

Creates a custom html compliant <icon-{name}>... Intended to be used with a Global Dict of icons {"home": "<svg...", "info": "<svg..."} Icon('home') -> <icon-home> .... </icon-home>

1
2
3
4
5
6
7
8
9
def Icon(
    name: str,  # name of the icon MUST be in icon_dict
    size=24,  # value to be passed to height and width of the icon
    stroke=1.5,  # stroke width
    icon_dict: dict=icons  # Dict of icons {"name":"<svg...>"}
):
    """Creates a custom html compliant <icon-{name}>... 
Intended to be used with a Global Dict of icons {"home": "<svg...", "info": "<svg..."} 
Icon('home') -> <icon-home> ....  </icon-home>"""