File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1616node_modules
1717package.json
1818package-lock.json
19+
20+ # this project
21+ sample_code.html
22+
Original file line number Diff line number Diff line change 1+ import os
2+
3+ import markdown
4+ from markdown_mermaid_cli import MermaidExtension
5+
6+ markdown_text = """
7+ # Sample Markdown with Mermaid Diagram
8+
9+ ## Mermaid Diagram
10+
11+ ```mermaid format=svg width=500 alt="sequenceDiagram" theme="forest" backgroundColor="#dcdcdc"
12+ sequenceDiagram
13+ participant Alice
14+ participant Bob
15+ Bob->>Alice: Hi Alice
16+ Alice->>Bob: Hi Bob
17+ ```
18+ """
19+
20+ html_output = markdown .markdown (markdown_text , extensions = [MermaidExtension ()])
21+
22+ with open (os .path .splitext (__file__ )[0 ] + '.html' , 'w' ) as f :
23+ f .write (html_output )
You can’t perform that action at this time.
0 commit comments