Skip to content

Commit f48d7ee

Browse files
committed
Move printing styles to scripts folder
1 parent c087d8d commit f48d7ee

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

scripts/style_list.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from table2ascii import styles
2+
from table2ascii.table_to_ascii import table2ascii
3+
4+
# prints all themes with previews
5+
if __name__ == "__main__":
6+
styles = {
7+
"thin": styles.thin,
8+
"thin_box": styles.thin_box,
9+
"thin_rounded": styles.thin_rounded,
10+
"thin_compact": styles.thin_compact,
11+
"thin_compact_rounded": styles.thin_compact_rounded,
12+
"thin_thick": styles.thin_thick,
13+
"thin_thick_rounded": styles.thin_thick_rounded,
14+
"thin_double": styles.thin_double,
15+
"thin_double_rounded": styles.thin_double_rounded,
16+
"thick": styles.thick,
17+
"thick_box": styles.thick_box,
18+
"thick_compact": styles.thick_compact,
19+
"double": styles.double,
20+
"double_box": styles.double_box,
21+
"double_compact": styles.double_compact,
22+
"double_thin": styles.double_thin,
23+
"double_thin_compact": styles.double_thin_compact,
24+
"minimalist": styles.minimalist,
25+
"borderless": styles.borderless,
26+
"ascii": styles.ascii,
27+
"ascii_box": styles.ascii_box,
28+
"ascii_compact": styles.ascii_compact,
29+
"ascii_double": styles.ascii_double,
30+
"ascii_minimalist": styles.ascii_minimalist,
31+
"ascii_borderless": styles.ascii_borderless,
32+
"ascii_simple": styles.ascii_simple,
33+
"markdown": styles.markdown,
34+
}
35+
for style in list(styles.keys()):
36+
full = table2ascii(
37+
header=["#", "G", "H", "R", "S"],
38+
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
39+
footer=["SUM", "130", "140", "135", "130"],
40+
first_col_heading=True,
41+
last_col_heading=False,
42+
style=styles[style],
43+
)
44+
body_only = table2ascii(
45+
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
46+
first_col_heading=True,
47+
last_col_heading=False,
48+
style=styles[style],
49+
)
50+
print(f"### `{style}`\n\n```\n{full}\n\n{body_only}\n```\n")

0 commit comments

Comments
 (0)