Skip to content

Commit 038c600

Browse files
committed
Updated examples and links
1 parent 5da8260 commit 038c600

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

docs/source/api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ PresetStyle
2121
.. autoclass:: PresetStyle
2222
:members:
2323

24+
.. _TableStyle:
25+
2426
TableStyle
2527
~~~~~~~~~~
2628

docs/source/generate_style_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def generate_style_list():
1515
# make a dict mapping style names to TableStyles
1616
styles = dict(zip(attribute_names, attributes))
1717
# README output variables
18-
heading = "Preset styles\n-------------"
18+
heading = ".. _styles:\n\nPreset styles\n-------------"
1919
table_of_contents = ".. contents::\n"
2020
style_list = ""
2121
# generate tables for each style

docs/source/usage.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@ Use a preset style
103103
Define a custom style
104104
~~~~~~~~~~~~~~~~~~~~~
105105

106-
Check
107-
`TableStyle <https://github.com/DenverCoder1/table2ascii/blob/main/table2ascii/table_style.py>`_
108-
for more info and
109-
`PresetStyle <https://github.com/DenverCoder1/table2ascii/blob/main/table2ascii/preset_style.py>`_
110-
for examples.
106+
Check :ref:`TableStyle` for more info.
111107

112108
.. code:: py
113109

table2ascii/alignment.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
import enum
1+
from enum import Enum
22

33

4-
class Alignment(enum.Enum):
4+
class Alignment(Enum):
55
"""
66
Enum for text alignment types within a table cell
7+
8+
Example::
9+
10+
from table2ascii import Alignment
11+
12+
output = table2ascii(
13+
...
14+
alignments=[Alignment.LEFT, Alignment.RIGHT, Alignment.CENTER, Alignment.CENTER]
15+
)
716
"""
817

918
LEFT = 0

table2ascii/preset_style.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@
33

44
class PresetStyle:
55
"""
6-
Importable preset styles for more easily selecting a table style
6+
Importable preset styles for more easily selecting a :ref:`TableStyle`.
77
8-
See the :ref:`styles` for more information on the available styles.
8+
See the :ref:`Preset Styles<styles>` for more information on the available styles.
9+
10+
Example::
11+
12+
from table2ascii import PresetStyle
13+
14+
output = table2ascii(
15+
...
16+
style=PresetStyle.ascii_box
17+
)
918
"""
1019

1120
thin = TableStyle.from_string("┌─┬─┐││ ├─┼─┤├─┼─┤└┴─┘")

0 commit comments

Comments
 (0)