Skip to content

Commit 1e65031

Browse files
authored
docs(readme): Readability improvements and subheading emojis (#55)
1 parent d8bf8fc commit 1e65031

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Documentation and examples are available at [table2ascii.rtfd.io](https://table2
1818

1919
## 🧑‍💻 Usage
2020

21-
### Convert lists to ASCII tables
21+
### 🚀 Convert lists to ASCII tables
2222

2323
```py
2424
from table2ascii import table2ascii
@@ -43,7 +43,7 @@ print(output)
4343
"""
4444
```
4545

46-
### Set first or last column headings
46+
### 🏆 Set first or last column headings
4747

4848
```py
4949
from table2ascii import table2ascii
@@ -63,7 +63,7 @@ print(output)
6363
"""
6464
```
6565

66-
### Set column widths and alignments
66+
### 📰 Set column widths and alignments
6767

6868
```py
6969
from table2ascii import table2ascii, Alignment
@@ -72,8 +72,8 @@ output = table2ascii(
7272
header=["#", "G", "H", "R", "S"],
7373
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
7474
first_col_heading=True,
75-
column_widths=[5] * 5, # [5, 5, 5, 5, 5]
76-
alignments=[Alignment.LEFT] + [Alignment.RIGHT] * 4, # First is left, remaining 4 are right
75+
column_widths=[5, 5, 5, 5, 5]
76+
alignments=[Alignment.LEFT, Alignment.RIGHT, Alignment.RIGHT, Alignment.RIGHT, Alignment.RIGHT],
7777
)
7878

7979
print(output)
@@ -88,15 +88,17 @@ print(output)
8888
"""
8989
```
9090

91-
### Use a preset style
91+
### 🎨 Use a preset style
92+
93+
See a list of 30+ preset styles [here](https://table2ascii.readthedocs.io/en/latest/styles.html).
9294

9395
```py
9496
from table2ascii import table2ascii, Alignment, PresetStyle
9597

9698
output = table2ascii(
9799
header=["First", "Second", "Third", "Fourth"],
98100
body=[["10", "30", "40", "35"], ["20", "10", "20", "5"]],
99-
column_widths=[10] * 4,
101+
column_widths=[10, 10, 10, 10],
100102
style=PresetStyle.ascii_box
101103
)
102104

@@ -129,7 +131,7 @@ First Second Third Fourth
129131
"""
130132
```
131133

132-
### Define a custom style
134+
### 🎲 Define a custom style
133135

134136
Check [`TableStyle`](https://github.com/DenverCoder1/table2ascii/blob/main/table2ascii/table_style.py) for more info and [`PresetStyle`](https://github.com/DenverCoder1/table2ascii/blob/main/table2ascii/preset_style.py) for examples.
135137

@@ -157,10 +159,6 @@ print(output)
157159
"""
158160
```
159161

160-
## 🎨 Preset styles
161-
162-
See a list of all preset styles [here](https://table2ascii.readthedocs.io/en/latest/styles.html).
163-
164162
## ⚙️ Options
165163

166164
All parameters are optional.
@@ -172,23 +170,25 @@ All parameters are optional.
172170
| `footer` | `List[Any]` | `None` | Last table row seperated by header row seperator. Values should support `str()`. |
173171
| `column_widths` | `List[Optional[int]]` | `None` (automatic) | List of column widths in characters for each column |
174172
| `alignments` | `List[Alignment]` | `None` (all centered) | Column alignments<br/>(ex. `[Alignment.LEFT, Alignment.CENTER, Alignment.RIGHT]`) |
175-
| `style` | `TableStyle` | `double_thin_compact` | Table style to use for the table |
173+
| `style` | `TableStyle` | `double_thin_compact` | Table style to use for the table\* |
176174
| `first_col_heading` | `bool` | `False` | Whether to add a heading column seperator after the first column |
177175
| `last_col_heading` | `bool` | `False` | Whether to add a heading column seperator before the last column |
178176
| `cell_padding` | `int` | `1` | The minimum number of spaces to add between the cell content and the cell border. |
179177

178+
\*See a list of all preset styles [here](https://table2ascii.readthedocs.io/en/latest/styles.html).
179+
180180
See the [API Reference](https://table2ascii.readthedocs.io/en/latest/api.html) for more info.
181181

182182
## 👨‍🎨 Use cases
183183

184-
### Discord messages and embeds
184+
### 🗨️ Discord messages and embeds
185185

186186
- Display tables nicely inside markdown code blocks on Discord
187187
- Useful for making Discord bots with [Discord.py](https://github.com/Rapptz/discord.py)
188188

189189
![image](https://user-images.githubusercontent.com/20955511/116203248-2973c600-a744-11eb-97d8-4b75ed2845c9.png)
190190

191-
### Terminal outputs
191+
### 💻 Terminal outputs
192192

193193
- Tables display nicely whenever monospace fonts are fully supported
194194
- Tables make terminal outputs look more professional

0 commit comments

Comments
 (0)