diff --git a/autodoc/autodoc.py b/autodoc/autodoc.py index 42cc26d..ca0699b 100644 --- a/autodoc/autodoc.py +++ b/autodoc/autodoc.py @@ -8,6 +8,16 @@ import common as doc from doc_state import * +def __doc_app_state__(state, tab=" │ "): + res = "" + if "+Threads" in state: + for i, tname in enumerate(state["+Threads"]): + if tname[0] == "+": + ch = "├─●" if i < len(state["+Threads"]) - 1 else "╰─●" + res += f"{tab} {ch} {tname[1:]}\n" + return res + + def __doc_application__(label, app): mdapp = f'\n## Real-time application "{label[1:]}"\n\n' mdapp += f"Below are descrbed the states and threads of the real-time application {label[1:]}.\n" @@ -21,7 +31,7 @@ def __doc_application__(label, app): tab = " │ " if i < len(states) - 1 else " " if label[0] == "+": mdapp += f" {ch} {label[1:]}\n" - mdapp += doc_app_state(obj, tab) + mdapp += __doc_app_state__(obj, tab) mdapp += "```\n" for label, obj in states.items(): if label[0] == "+":