Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jul 22, 2018
1 parent 4e0d433 commit 2ff2196
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
v0.8.0 (in development)
-----------------------
- Added `left_border`, `right_border`, `top_border`, and `bottom_border`
options

v0.7.0 (2017-07-18)
-------------------
Expand Down
47 changes: 39 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,22 @@ constructor or as attributes on a ``Txtble`` instance::
``border=True``
Whether to draw a border around the edge of the table. ``border`` may
optionally be set to a ``BorderStyle`` instance to set the characters used
for drawing the border around the edge of the table.
for drawing the border around the edge of the table. Individual edges can
be toggled or stylized by setting the ``bottom_border``, ``left_border``,
``right_border``, and ``top_border`` options.

``border_style=ASCII_BORDERS``
Sets the default characters used for drawing all of the table's borders &
rules. The border style can be overridden for individual borders by setting
their respective options (``border``, ``column_border``, etc.). See
"`BorderStyle <borderstyle_>`_" below for more information.
A ``BorderStyle`` instance specifying the characters to use for drawing all
of the table's borders & rules. The border style can be overridden for
individual borders by setting their respective options (``border``,
``column_border``, etc.) to ``BorderStyle`` instances. See "`BorderStyle
<borderstyle_>`_" below for more information.

``bottom_border=None``
Whether to draw a border along the bottom edge of the table. The default
value of `None` means to inherit the value set for ``border``.
``bottom_border`` may optionally be set to a ``BorderStyle`` instance to set
the characters used for drawing the border along the bottom edge.

``break_long_words=True``
Whether to force a line break in the middle of a word if said word is too
Expand Down Expand Up @@ -413,10 +422,17 @@ constructor or as attributes on a ``Txtble`` instance::
non-`None` value or else a `ValueError` will be raised upon trying to render
the ``Txtble``.

``left_border=None``
Whether to draw a border along the left edge of the table. The default
value of `None` means to inherit the value set for ``border``.
``left_border`` may optionally be set to a ``BorderStyle`` instance to set
the characters used for drawing the border along the left edge.

``left_padding=None``
Padding to insert on the left of every table cell. This can be either an
integer (to insert that many space characters) or a string. If a string, it
may not contain any newlines. ``left_padding`` overrides ``padding``.
may not contain any newlines. The default value of `None` means to inherit
the value set for ``padding``.

``len_func``
The function to use for calculating how many terminal cells wide a string
Expand All @@ -432,12 +448,21 @@ constructor or as attributes on a ``Txtble`` instance::
``padding=0``
Padding to insert on the left & right of every table cell. This can be
either an integer (to insert that many space characters) or a string. If a
string, it may not contain any newlines.
string, it may not contain any newlines. Padding for the left and right of
table cells can be specified separately via the ``left_padding`` and
``right_padding`` options.

``right_border=None``
Whether to draw a border along the right edge of the table. The default
value of `None` means to inherit the value set for ``border``.
``right_border`` may optionally be set to a ``BorderStyle`` instance to set
the characters used for drawing the border along the right edge.

``right_padding=None``
Padding to insert on the right of every table cell. This can be either an
integer (to insert that many space characters) or a string. If a string, it
may not contain any newlines. ``right_padding`` overrides ``padding``.
may not contain any newlines. The default value of `None` means to inherit
the value set for ``padding``.

``row_border=False``
Whether to draw horizontal rules between data rows. ``row_border`` may
Expand All @@ -457,6 +482,12 @@ constructor or as attributes on a ``Txtble`` instance::
border to align.) This option is useful if you wish to append text to one
or more lines of the output and have it appear strictly outside the table.

``top_border=None``
Whether to draw a border along the top edge of the table. The default value
of `None` means to inherit the value set for ``border``. ``top_border`` may
optionally be set to a ``BorderStyle`` instance to set the characters used
for drawing the border along the top edge.

``width_fill=None``
If there are more columns than there are entries in ``widths``, the extra
columns will have their widths set to ``width_fill``.
Expand Down
7 changes: 2 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@ Features to Add
indicate that a horizontal rule should be added. Its constructor should
take an optional `border_style` argument.
- easy way to change just the column separator in non-rule rows?
- Allow `column_border` to be just a string? (since only one string of
`BorderStyle` gets used anyway)
- Allow `column_border`, `left_border`, and `right_border` to be just a
string? (since only one string of `BorderStyle` gets used anyway)
- easy way to change the column separator in all rows?
- "doubling" ('|' → '||') specific vrules
- using different column vrules in the header (and/or header rule) than in
the data?
- drawing left & right border vrules but no top/bottom hrules
- drawing top & bottom border hrules but not left/right vrules
- drawing just a top or just a bottom border hrule

- Cell alignment:
- Add an 'n' alignment option for aligning numeric values along a decimal
Expand Down

0 comments on commit 2ff2196

Please sign in to comment.