ds2mermaid package¶
Module contents¶
Mermaid diagram subclass and helper functions.
- class ds2mermaid.MermaidGraph(diagram_type='graph', diagram_direction='TB', subgraphs=None)[source]¶
Bases:
MermaidDiagram
A mermaid subclass for generating subgraph diagrams.
- Parameters:
diagram_type (str) – mermaid diagram type
diagram_direction (str) – mermaid graph direction
subgraphs (List | None) – list of doorstop prefix labels for subgraphs
- class ds2mermaid.SubGraph(name, nodes=None)[source]¶
Bases:
object
A SubGraph class to represent mermaid subgraphs (ie, individual subgraph parts of a mermaid diagram).
- Parameters:
name (str) – prefix label for subgraph
nodes (List | None) – list of prefix labels for subgraph nodes
- ds2mermaid.check_for_doorstop()[source]¶
Make sure we can find the
doorstop
binary in the user environment and return a path string.- Returns:
program path string
- Return type:
str
- ds2mermaid.create_subgraph_diagram(prefixes=None)[source]¶
Create a new graph diagram with subgraphs.
- Parameters:
prefixes (List | None)
- Return type:
- ds2mermaid.get_doorstop_doc_tree(tree)[source]¶
Parse the doorstop tree structure to get a list of document prefixes, starting with the root doc. The string repr looks like a simple ascii diagram:
tree <Tree TUI <- [ TST, SDD ]> str(tree) TUI <- [ TST, SDD ]
- Parameters:
tree (str) – doorstop tree cast to a str
- Returns:
list of document prefixes
- Return type:
List[str]