-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
executable file
·58 lines (45 loc) · 914 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
import markdown
def print_html(s):
m = markdown.markdown(s, extensions=['pm_attr_list', 'tables', 'def_list'])
print(m)
print()
print_html("""
First do these steps:
1. Item
{ .myitem ^ .mylist }
2. Item
{ #item2 ^ #list1 }
3. Item
Don't forget to finish with these steps:
4. Item
{ ^ start=4 .important }
5. Especially the last one!
{ style="font-style: bold" }
""")
# Nested list
print_html("""
* Item 1
{ ^ .toplist }
3. Third!
{ ^ .sublist start=3 }
4. Fourth!
5. Fifth!
* Item 2
* Item 3
""")
# Table
print_html("""
Name | Value
----------|-------
Something | Yes { #yes ^ .table }
Other | No { #no }
""")
# Definition list
print_html("""
Apple { #apple ^ #fruit }
: Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
Orange { #orange ^ .deflist }
: The fruit of an evergreen tree of the genus Citrus.
""")