From f8363b456f1ab31ee56abad579b215af195093d5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 14 May 2024 22:18:28 +0200 Subject: Adding upstream version 9.11.0. Signed-off-by: Daniel Baumann --- docs/source/appendix/box.rst | 79 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 docs/source/appendix/box.rst (limited to 'docs/source/appendix/box.rst') diff --git a/docs/source/appendix/box.rst b/docs/source/appendix/box.rst new file mode 100644 index 0000000..9178953 --- /dev/null +++ b/docs/source/appendix/box.rst @@ -0,0 +1,79 @@ +.. _appendix_box: + +Box +=== + +Rich has a number of constants that set the box characters used to draw tables and panels. To select a box style import one of the constants below from ``rich.box``. For example:: + + from rich import box + table = Table(box=box.SQUARE) + + +.. note:: + Some of the box drawing characters will not display correctly on Windows legacy terminal (cmd.exe) with *raster* fonts, and are disabled by default. If you want the full range of box options on Windows legacy terminal, use a *truetype* font and set the ``safe_box`` parameter on the Table class to ``False``. + + +The following table is generated with this command:: + + python -m rich.box + +.. raw:: html + +
╭──────────────────────────────────────────────────────────────────────────────╮
+                                    Box Constants                                 │
+    ╰──────────────────────────────────────────────────────────────────────────────╯
+
+            box.ASCII                   box.SQUARE                box.MINIMAL       
+    +------------------------+  ┌────────────┬───────────┐                          
+    | Header 1   | Header 2  |  │ Header 1    Header 2   Header 1   Header 2  
+    |------------+-----------|  ├────────────┼───────────┤   ───────────┼────────── 
+    | Cell       | Cell      |  │ Cell        Cell       Cell       Cell      
+    | Cell       | Cell      |  │ Cell        Cell       Cell       Cell      
+    |------------+-----------|  ├────────────┼───────────┤   ───────────┼────────── 
+    | Footer 1   | Footer 2  |  │ Footer 1    Footer 2   Footer 1   Footer 2  
+    +------------------------+  └────────────┴───────────┘                          
+                                                                                    
+                                                                                    
+      box.MINIMAL_HEAVY_HEAD     box.MINIMAL_DOUBLE_HEAD           box.SIMPLE       
+                                                                                    
+      Header 1    Header 2       Header 1    Header 2       Header 1    Header 2  
+     ━━━━━━━━━━━━┿━━━━━━━━━━━    ════════════╪═══════════   ────────────────────────
+      Cell        Cell           Cell        Cell           Cell        Cell      
+      Cell        Cell           Cell        Cell           Cell        Cell      
+     ────────────┼───────────    ────────────┼───────────   ────────────────────────
+      Footer 1    Footer 2       Footer 1    Footer 2       Footer 1    Footer 2  
+                                                                                    
+                                                                                    
+                                                                                    
+         box.SIMPLE_HEAVY            box.HORIZONTALS              box.ROUNDED       
+                                ──────────────────────────  ╭───────────┬──────────╮
+      Header 1     Header 2       Header 1     Header 2   Header 1   Header 2 │
+    ╺━━━━━━━━━━━━━━━━━━━━━━━━╸  ──────────────────────────  ├───────────┼──────────┤
+      Cell         Cell           Cell         Cell       Cell       Cell     │
+      Cell         Cell           Cell         Cell       Cell       Cell     │
+    ╺━━━━━━━━━━━━━━━━━━━━━━━━╸  ──────────────────────────  ├───────────┼──────────┤
+      Footer 1     Footer 2       Footer 1     Footer 2   Footer 1   Footer 2 │
+                                ──────────────────────────  ╰───────────┴──────────╯
+                                                                                    
+                                                                                    
+            box.HEAVY                 box.HEAVY_EDGE             box.HEAVY_HEAD     
+    ┏━━━━━━━━━━━━┳━━━━━━━━━━━┓  ┏━━━━━━━━━━━━┯━━━━━━━━━━━┓  ┏━━━━━━━━━━━┳━━━━━━━━━━┓
+    ┃ Header 1    Header 2  ┃  ┃ Header 1    Header 2  ┃  ┃ Header 1   Header 2 ┃
+    ┣━━━━━━━━━━━━╋━━━━━━━━━━━┫  ┠────────────┼───────────┨  ┡━━━━━━━━━━━╇━━━━━━━━━━┩
+    ┃ Cell        Cell      ┃  ┃ Cell        Cell      ┃  │ Cell       Cell     │
+    ┃ Cell        Cell      ┃  ┃ Cell        Cell      ┃  │ Cell       Cell     │
+    ┣━━━━━━━━━━━━╋━━━━━━━━━━━┫  ┠────────────┼───────────┨  ├───────────┼──────────┤
+    ┃ Footer 1    Footer 2  ┃  ┃ Footer 1    Footer 2  ┃  │ Footer 1   Footer 2 │
+    ┗━━━━━━━━━━━━┻━━━━━━━━━━━┛  ┗━━━━━━━━━━━━┷━━━━━━━━━━━┛  └───────────┴──────────┘
+                                                                                    
+                                                                                    
+            box.DOUBLE               box.DOUBLE_EDGE                                
+    ╔════════════╦═══════════╗  ╔════════════╤═══════════╗                          
+    ║ Header 1    Header 2  ║  ║ Header 1    Header 2  ║                          
+    ╠════════════╬═══════════╣  ╟────────────┼───────────╢                          
+    ║ Cell        Cell      ║  ║ Cell        Cell      ║                          
+    ║ Cell        Cell      ║  ║ Cell        Cell      ║                          
+    ╠════════════╬═══════════╣  ╟────────────┼───────────╢                          
+    ║ Footer 1    Footer 2  ║  ║ Footer 1    Footer 2  ║                          
+    ╚════════════╩═══════════╝  ╚════════════╧═══════════╝                          
+    
-- cgit v1.2.3