|
1 | 1 | from .table_style import TableStyle
|
2 | 2 |
|
| 3 | +thin = TableStyle.from_string("┌─┬─┐││ ├─┼─┤├─┼─┤└┴─┘") |
| 4 | +thin_rounded = TableStyle.from_string("╭─┬─╮││ ├─┼─┤├─┼─┤╰┴─╯") |
| 5 | +thin_compact = TableStyle.from_string("┌─┬─┐││ ├─┼─┤ └┴─┘") |
| 6 | +thin_compact_rounded = TableStyle.from_string("╭─┬─╮││ ├─┼─┤ ╰┴─╯") |
| 7 | +thin_thick = TableStyle.from_string("┌─┬─┐││ ┝━┿━┥├─┼─┤└┴─┘") |
| 8 | +thin_thick_rounded = TableStyle.from_string("╭─┬─╮││ ┝━┿━┥├─┼─┤╰┴─╯") |
| 9 | +thin_double = TableStyle.from_string("┌─┬─┐││ ╞═╪═╡├─┼─┤└┴─┘") |
| 10 | +thin_double_rounded = TableStyle.from_string("╭─┬─╮││ ╞═╪═╡├─┼─┤╰┴─╯") |
| 11 | +thick_compact = TableStyle.from_string("┏━┳━┓┃┃ ┣━╋━┫ ┗┻━┛") |
| 12 | +double = TableStyle.from_string("╔═╦═╗║║ ╠═╬═╣╠═╬═╣╚╩═╝") |
| 13 | +double_compact = TableStyle.from_string("╔═╦═╗║║ ╠═╬═╣ ╚╩═╝") |
| 14 | +double_thin = TableStyle.from_string("╔═╦═╗║║ ╟─╫─╢╠═╬═╣╚╩═╝") |
| 15 | +minimalist = TableStyle.from_string(" ─── ━━━ ─── ── ") |
| 16 | +ascii_compact = TableStyle.from_string("+-+-+|| +-+-+ ++-+") |
| 17 | +ascii_double = TableStyle.from_string("+-+-+|| +=+=++-+-+++-+") |
| 18 | +ascii_minimalist = TableStyle.from_string(" --- === --- -- ") |
| 19 | +markdown = TableStyle.from_string(" ||||-||| ") |
3 | 20 |
|
4 |
| -a = TableStyle.from_string("┌─┬─┐││ ├─┼─┤└┴─┘") |
5 |
| -b = TableStyle.from_string("┌─┬─┐││┝━┿━┥├─┼─┤└┴─┘") |
6 |
| -c = TableStyle.from_string("┌─┬─┐││╞═╪═╡├─┼─┤└┴─┘") |
7 |
| -d = TableStyle.from_string("╭─┬─╮││ ├─┼─┤╰┴─╯") |
8 |
| -e = TableStyle.from_string("╭─┬─╮││┝━┿━┥├─┼─┤╰┴─╯") |
9 |
| -f = TableStyle.from_string("╭─┬─╮││╞═╪═╡├─┼─┤╰┴─╯") |
10 |
| -g = TableStyle.from_string("┏━┳━┓┃┃ ┣━╋━┫┗┻━┛") |
11 |
| -h = TableStyle.from_string("┌─┬─┐││┠─╂─┨├─┼─┤└┴─┘") |
12 |
| -i = TableStyle.from_string("╔═╦═╗║║ ╠═╬═╣╚╩═╝") |
13 |
| -j = TableStyle.from_string("╔═╦═╗║║╟─╫─╢╠═╬═╣╚╩═╝") |
14 |
| -k = TableStyle.from_string(" ─── ━━━ ─── ── ") |
15 |
| -l = TableStyle.from_string("+-+-+|| +-+-+++-+") |
16 |
| -m = TableStyle.from_string("+-+-+||+=+=++-+-+++-+") |
17 |
| -n = TableStyle.from_string("+=+=+HH +=+=+++=+") |
18 |
| -o = TableStyle.from_string("+=+=+HH+-+-++=+=+++=+") |
19 |
| -p = TableStyle.from_string(" --- === --- -- ") |
20 |
| -q = TableStyle.from_string(" |||-|-| ") |
| 21 | +# prints all themes with previews |
| 22 | +if __name__ == "__main__": |
| 23 | + from .table_to_ascii import table2ascii |
| 24 | + |
| 25 | + styles = { |
| 26 | + "thin": thin, |
| 27 | + "thin_rounded": thin_rounded, |
| 28 | + "thin_compact": thin_compact, |
| 29 | + "thin_compact_rounded": thin_compact_rounded, |
| 30 | + "thin_thick": thin_thick, |
| 31 | + "thin_thick_rounded": thin_thick_rounded, |
| 32 | + "thin_double": thin_double, |
| 33 | + "thin_double_rounded": thin_double_rounded, |
| 34 | + "thick_compact": thick_compact, |
| 35 | + "double": double, |
| 36 | + "double_compact": double_compact, |
| 37 | + "double_thin": double_thin, |
| 38 | + "minimalist": minimalist, |
| 39 | + "ascii_compact": ascii_compact, |
| 40 | + "ascii_double": ascii_double, |
| 41 | + "ascii_minimalist": ascii_minimalist, |
| 42 | + "markdown": markdown, |
| 43 | + } |
| 44 | + for style in list(styles.keys()): |
| 45 | + full = table2ascii( |
| 46 | + header=["#", "G", "H", "R", "S"], |
| 47 | + body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]], |
| 48 | + footer=["SUM", "130", "140", "135", "130"], |
| 49 | + first_col_heading=True, |
| 50 | + last_col_heading=False, |
| 51 | + style=styles[style], |
| 52 | + ) |
| 53 | + body_only = table2ascii( |
| 54 | + body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]], |
| 55 | + first_col_heading=True, |
| 56 | + last_col_heading=False, |
| 57 | + style=styles[style], |
| 58 | + ) |
| 59 | + print(f"### `{style}`\n\n```\n{full}\n{body_only}```\n") |
0 commit comments