Skip to content

summary

Helper functions to create a SUMMARY.md file that can be used with the mkdocs literate-nav plugin.

create_summary

create_summary(items: list) -> str

Create a markdown summary for a list of file paths.

The generated markdown can be used to create a SUMMARY.md file for the literate-nav mkdocs-plugin

Parameters:

  • items (list) –

    A list of paths

Returns:

  • str

    A markdown string.

Source code in src/robot_markdown/summary.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
def create_summary(items: list) -> str:
    """Create a markdown summary for a list of file paths.

    The generated markdown can be used to create a SUMMARY.md file
    for the literate-nav mkdocs-plugin

    Parameters:
        items: A list of paths

    Returns:
        A markdown string.
    """
    summary_dict, _ = _create_dirtree(items)
    return _to_markdown(summary_dict)