File tree Expand file tree Collapse file tree 1 file changed +56
-56
lines changed
Expand file tree Collapse file tree 1 file changed +56
-56
lines changed Original file line number Diff line number Diff line change 1- # if __name__ == "__main__":
2-
3- from markdown_it import MarkdownIt
4- from markdown_it .extensions .front_matter import front_matter_plugin
5- from markdown_it .extensions .myst_blocks import myst_block_plugin
6- from markdown_it .extensions .myst_role import myst_role_plugin
7- from markdown_it .doc_renderer import DocRenderer
8-
9- md = MarkdownIt ().use (front_matter_plugin ).use (myst_block_plugin ).use (myst_role_plugin )
10- tokens = md .parse (
11- """\
12- ---
13- a: 1
14- b:
15- - c
16- ---
17- (xyz)=
18- # title
19- a
20- - b *c* **g**
21- - h
22- d
23- > +++
24- ---
25- ` a `
26- ```a dfg
27- mj
28- ```
29- ## a
30-
31- abc
32- ===
33-
34- <c@google.com>
35-
36- [a][b]
37-
38- [b]: s
39-
40- <div>A</div>
41-
42- a <span>a</span>
43-
44- 
45-
46- +++ axbc
47-
48- {role-name:}`abc`
49- """
50- )
51-
52- # print(get_nested(tokens))
53-
54- doc = DocRenderer ()
55- doc .run_render (tokens )
56- print (doc .document .pformat ())
1+ if __name__ == "__main__" :
2+
3+ from markdown_it import MarkdownIt
4+ from markdown_it .extensions .front_matter import front_matter_plugin
5+ from markdown_it .extensions .myst_blocks import myst_block_plugin
6+ from markdown_it .extensions .myst_role import myst_role_plugin
7+ from markdown_it .doc_renderer import DocRenderer
8+
9+ md = MarkdownIt ().use (front_matter_plugin ).use (myst_block_plugin ).use (myst_role_plugin )
10+ tokens = md .parse (
11+ """\
12+ ---
13+ a: 1
14+ b:
15+ - c
16+ ---
17+ (xyz)=
18+ # title
19+ a
20+ - b *c* **g**
21+ - h
22+ d
23+ > +++
24+ ---
25+ ` a `
26+ ```a dfg
27+ mj
28+ ```
29+ ## a
30+
31+ abc
32+ ===
33+
34+ <c@google.com>
35+
36+ [a][b]
37+
38+ [b]: s
39+
40+ <div>A</div>
41+
42+ a <span>a</span>
43+
44+ 
45+
46+ +++ axbc
47+
48+ {role-name:}`abc`
49+ """
50+ )
51+
52+ # print(get_nested(tokens))
53+
54+ doc = DocRenderer ()
55+ doc .run_render (tokens )
56+ print (doc .document .pformat ())
You can’t perform that action at this time.
0 commit comments