Skip to content

Commit 3fbf53a

Browse files
committed
box docs
1 parent 2ee992b commit 3fbf53a

File tree

2 files changed

+2
-39
lines changed

2 files changed

+2
-39
lines changed

docs/source/appendix/box.rst

+1-38
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,4 @@ The following table is generated with this command::
1717

1818
python -m rich.box
1919

20-
.. raw:: html
21-
22-
<pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace"> <span style="color: #008000; text-decoration-color: #008000">╭───────────────╮</span>
23-
<span style="color: #008000; text-decoration-color: #008000">│ </span><span style="color: #008000; text-decoration-color: #008000; font-weight: bold">Box Constants</span><span style="color: #008000; text-decoration-color: #008000"> │</span>
24-
<span style="color: #008000; text-decoration-color: #008000">╰───────────────╯</span>
25-
26-
<span style="color: #800080; text-decoration-color: #800080"> box.ASCII </span> <span style="color: #800080; text-decoration-color: #800080"> box.ASCII2 </span> <span style="color: #800080; text-decoration-color: #800080"> box.ASCII_DOUBLE_HEAD </span> <span style="color: #800080; text-decoration-color: #800080"> box.DOUBLE </span> <span style="color: #800080; text-decoration-color: #800080"> box.DOUBLE_EDGE </span> <span style="color: #800080; text-decoration-color: #800080"> box.HEAVY </span> <span style="color: #800080; text-decoration-color: #800080"> box.HEAVY_EDGE </span>
27-
+-----------------------+ +-----------+-----------+ +-----------+-----------+ ╔═══════════╦═══════════╗ ╔═══════════╤═══════════╗ ┏━━━━━━━━━━━┳━━━━━━━━━━━┓ ┏━━━━━━━━━━━┯━━━━━━━━━━┓
28-
|<span style="font-weight: bold"> Header 1 </span>|<span style="font-weight: bold"> Header 2 </span>| |<span style="font-weight: bold"> Header 1 </span>|<span style="font-weight: bold"> Header 2 </span>| |<span style="font-weight: bold"> Header 1 </span>|<span style="font-weight: bold"> Header 2 </span>| ║<span style="font-weight: bold"> Header 1 </span>║<span style="font-weight: bold"> Header 2 </span>║ ║<span style="font-weight: bold"> Header 1 </span>│<span style="font-weight: bold"> Header 2 </span>║ ┃<span style="font-weight: bold"> Header 1 </span>┃<span style="font-weight: bold"> Header 2 </span>┃ ┃<span style="font-weight: bold"> Header 1 </span>│<span style="font-weight: bold"> Header 2 </span>┃
29-
|-----------+-----------| +-----------+-----------+ +===========+===========+ ╠═══════════╬═══════════╣ ╟───────────┼───────────╢ ┣━━━━━━━━━━━╋━━━━━━━━━━━┫ ┠───────────┼──────────┨
30-
| Cell | Cell | | Cell | Cell | | Cell | Cell | ║ Cell ║ Cell ║ ║ Cell │ Cell ║ ┃ Cell ┃ Cell ┃ ┃ Cell │ Cell ┃
31-
| Cell | Cell | | Cell | Cell | | Cell | Cell | ║ Cell ║ Cell ║ ║ Cell │ Cell ║ ┃ Cell ┃ Cell ┃ ┃ Cell │ Cell ┃
32-
|-----------+-----------| +-----------+-----------+ +-----------+-----------+ ╠═══════════╬═══════════╣ ╟───────────┼───────────╢ ┣━━━━━━━━━━━╋━━━━━━━━━━━┫ ┠───────────┼──────────┨
33-
|<span style="font-weight: bold"> Footer 1 </span>|<span style="font-weight: bold"> Footer 2 </span>| |<span style="font-weight: bold"> Footer 1 </span>|<span style="font-weight: bold"> Footer 2 </span>| |<span style="font-weight: bold"> Footer 1 </span>|<span style="font-weight: bold"> Footer 2 </span>| ║<span style="font-weight: bold"> Footer 1 </span>║<span style="font-weight: bold"> Footer 2 </span>║ ║<span style="font-weight: bold"> Footer 1 </span>│<span style="font-weight: bold"> Footer 2 </span>║ ┃<span style="font-weight: bold"> Footer 1 </span>┃<span style="font-weight: bold"> Footer 2 </span>┃ ┃<span style="font-weight: bold"> Footer 1 </span>│<span style="font-weight: bold"> Footer 2 </span>┃
34-
+-----------------------+ +-----------+-----------+ +-----------+-----------+ ╚═══════════╩═══════════╝ ╚═══════════╧═══════════╝ ┗━━━━━━━━━━━┻━━━━━━━━━━━┛ ┗━━━━━━━━━━━┷━━━━━━━━━━┛
35-
36-
37-
<span style="color: #800080; text-decoration-color: #800080"> box.HEAVY_HEAD </span> <span style="color: #800080; text-decoration-color: #800080"> box.HORIZONTALS </span> <span style="color: #800080; text-decoration-color: #800080"> box.MARKDOWN </span> <span style="color: #800080; text-decoration-color: #800080"> box.MINIMAL </span> <span style="color: #800080; text-decoration-color: #800080"> box.MINIMAL_DOUBLE_HEAD </span> <span style="color: #800080; text-decoration-color: #800080"> box.MINIMAL_HEAVY_HEAD </span> <span style="color: #800080; text-decoration-color: #800080"> box.ROUNDED </span>
38-
┏━━━━━━━━━━━┳━━━━━━━━━━━┓ ─────────────────────── ╷ ╷ ╷ ╭───────────┬──────────╮
39-
┃<span style="font-weight: bold"> Header 1 </span>┃<span style="font-weight: bold"> Header 2 </span>┃ <span style="font-weight: bold"> Header 1 </span> <span style="font-weight: bold"> Header 2 </span> |<span style="font-weight: bold"> Header 1 </span>|<span style="font-weight: bold"> Header 2 </span>| <span style="font-weight: bold"> Header 1 </span>│<span style="font-weight: bold"> Header 2 </span> <span style="font-weight: bold"> Header 1 </span>│<span style="font-weight: bold"> Header 2 </span> <span style="font-weight: bold"> Header 1 </span>│<span style="font-weight: bold"> Header 2 </span> │<span style="font-weight: bold"> Header 1 </span>│<span style="font-weight: bold"> Header 2 </span>│
40-
┡━━━━━━━━━━━╇━━━━━━━━━━━┩ ─────────────────────── |-----------|-----------| ╶───────────┼───────────╴ ═══════════╪═══════════ ╺━━━━━━━━━━━┿━━━━━━━━━━━╸ ├───────────┼──────────┤
41-
│ Cell │ Cell │ Cell Cell | Cell | Cell | Cell │ Cell Cell │ Cell Cell │ Cell │ Cell │ Cell │
42-
│ Cell │ Cell │ Cell Cell | Cell | Cell | Cell │ Cell Cell │ Cell Cell │ Cell │ Cell │ Cell │
43-
├───────────┼───────────┤ ─────────────────────── |-----------|-----------| ╶───────────┼───────────╴ ───────────┼─────────── ╶───────────┼───────────╴ ├───────────┼──────────┤
44-
│<span style="font-weight: bold"> Footer 1 </span>│<span style="font-weight: bold"> Footer 2 </span>│ <span style="font-weight: bold"> Footer 1 </span> <span style="font-weight: bold"> Footer 2 </span> |<span style="font-weight: bold"> Footer 1 </span>|<span style="font-weight: bold"> Footer 2 </span>| <span style="font-weight: bold"> Footer 1 </span>│<span style="font-weight: bold"> Footer 2 </span> <span style="font-weight: bold"> Footer 1 </span>│<span style="font-weight: bold"> Footer 2 </span> <span style="font-weight: bold"> Footer 1 </span>│<span style="font-weight: bold"> Footer 2 </span> │<span style="font-weight: bold"> Footer 1 </span>│<span style="font-weight: bold"> Footer 2 </span>│
45-
└───────────┴───────────┘ ─────────────────────── ╵ ╵ ╵ ╰───────────┴──────────╯
46-
47-
48-
<span style="color: #800080; text-decoration-color: #800080"> box.SIMPLE </span> <span style="color: #800080; text-decoration-color: #800080"> box.SIMPLE_HEAD </span> <span style="color: #800080; text-decoration-color: #800080"> box.SIMPLE_HEAVY </span> <span style="color: #800080; text-decoration-color: #800080"> box.SQUARE </span> <span style="color: #800080; text-decoration-color: #800080"> box.SQUARE_DOUBLE_HEAD </span>
49-
┌───────────┬───────────┐ ┌───────────┬───────────┐
50-
<span style="font-weight: bold"> Header 1 </span> <span style="font-weight: bold"> Header 2 </span> <span style="font-weight: bold"> Header 1 </span> <span style="font-weight: bold"> Header 2 </span> <span style="font-weight: bold"> Header 1 </span> <span style="font-weight: bold"> Header 2 </span> │<span style="font-weight: bold"> Header 1 </span>│<span style="font-weight: bold"> Header 2 </span>│ │<span style="font-weight: bold"> Header 1 </span>│<span style="font-weight: bold"> Header 2 </span>│
51-
─────────────────────── ─────────────────────── ━━━━━━━━━━━━━━━━━━━━━━━ ├───────────┼───────────┤ ╞═══════════╪═══════════╡
52-
Cell Cell Cell Cell Cell Cell │ Cell │ Cell │ │ Cell │ Cell │
53-
Cell Cell Cell Cell Cell Cell │ Cell │ Cell │ │ Cell │ Cell │
54-
─────────────────────── ━━━━━━━━━━━━━━━━━━━━━━━ ├───────────┼───────────┤ ├───────────┼───────────┤
55-
<span style="font-weight: bold"> Footer 1 </span> <span style="font-weight: bold"> Footer 2 </span> <span style="font-weight: bold"> Footer 1 </span> <span style="font-weight: bold"> Footer 2 </span> <span style="font-weight: bold"> Footer 1 </span> <span style="font-weight: bold"> Footer 2 </span> │<span style="font-weight: bold"> Footer 1 </span>│<span style="font-weight: bold"> Footer 2 </span>│ │<span style="font-weight: bold"> Footer 1 </span>│<span style="font-weight: bold"> Footer 2 </span>│
56-
└───────────┴───────────┘ └───────────┴───────────┘
57-
</pre>
20+
.. image:: ../../images/box.svg

rich/box.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,4 @@ def get_bottom(self, widths: Iterable[int]) -> str:
514514
columns.add_renderable(table)
515515
console.print(columns)
516516

517-
# console.save_html("box.html", inline_styles=True)
517+
# console.save_svg("box.svg")

0 commit comments

Comments
 (0)