Ah cool! In which case, done :)
$ ./universal.py ../report_dfd/example.py > ../report_dfd/threatspec.json
...
$ ./mermaid.py threatspec.json
graph LR
classDef exposures fill:#e74c3c,stroke:#333,stroke-width:2px;
classDef mitigations fill:#2ecc71,stroke:#333,stroke-width:2px;
classDef transfers fill:#9b59b6,stroke:#333,stroke-width:2px;
classDef acceptances fill:#f39c12,stroke:#333,stroke-width:2px;
classDef reviews fill:#3498db,stroke:#333,stroke-width:2px;
subgraph Web / ELB
web_loadbalancers("Load balancers")
end
It's basically just a wrapper around _parse_comment, so will match any line that matches the pattern:
comments = ['//', '/*', '#', '"""', '\'\'\'']
tags = ['alias','describe','connects','review','mitigates','exposes','transfers','accepts']
self.parser.node_regex = "^\s*(?:{})*\s*@(?:{}).*$".format('|'.join(map(lambda c: re.escape(c), comments)), '|'.join(map(lambda t: re.escape(t), tags)))
My plan for this week is to get these code changes pushed to git.