From 2ff2196351e38df874a446ebb5ff04669e94bc73 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Sun, 22 Jul 2018 13:52:47 -0400 Subject: [PATCH] Update documentation --- CHANGELOG.md | 2 ++ README.rst | 47 +++++++++++++++++++++++++++++++++++++++-------- TODO.md | 7 ++----- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fbcee6..751139d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) ------------------- diff --git a/README.rst b/README.rst index 9c7be3b..3496304 100644 --- a/README.rst +++ b/README.rst @@ -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 `_" 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 + `_" 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 @@ -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 @@ -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 @@ -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``. diff --git a/TODO.md b/TODO.md index 0d6d3ff..bc5345b 100644 --- a/TODO.md +++ b/TODO.md @@ -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