diff --git a/docs/widgets/data_table.md b/docs/widgets/data_table.md index 0ae59829b..05c740998 100644 --- a/docs/widgets/data_table.md +++ b/docs/widgets/data_table.md @@ -217,3 +217,8 @@ The data table widget provides the following component classes: ::: textual.widgets.DataTable options: heading_level: 2 + +::: textual.widgets.data_table + options: + show_root_heading: true + show_root_toc_entry: true diff --git a/src/textual/widgets/_data_table.py b/src/textual/widgets/_data_table.py index 4f1f574cf..62aa1e546 100644 --- a/src/textual/widgets/_data_table.py +++ b/src/textual/widgets/_data_table.py @@ -38,7 +38,7 @@ CellCacheKey: TypeAlias = ( LineCacheKey: TypeAlias = "tuple[int, int, int, int, Coordinate, Coordinate, Style, CursorType, bool, int, PseudoClasses]" RowCacheKey: TypeAlias = "tuple[RowKey, int, Style, Coordinate, Coordinate, CursorType, bool, bool, int, PseudoClasses]" CursorType = Literal["cell", "row", "column", "none"] -"""The legal types of cursors for [`DataTable.cursor_type`][textual.widgets.DataTable.cursor_type].""" +"""The valid types of cursors for [`DataTable.cursor_type`][textual.widgets.DataTable.cursor_type].""" CellType = TypeVar("CellType") CELL_X_PADDING = 2 @@ -47,18 +47,18 @@ CELL_X_PADDING = 2 class CellDoesNotExist(Exception): """The cell key/index was invalid. - Raised when the user supplies coordinates or cell keys which - do not exist in the DataTable.""" + Raised when the coordinates or cell key provided does not exist + in the DataTable (e.g. out of bounds index, invalid key)""" class RowDoesNotExist(Exception): - """Raised when the user supplies a row index or row key which does - not exist in the DataTable (e.g. out of bounds index, invalid key)""" + """Raised when the row index or row key provided does not exist + in the DataTable (e.g. out of bounds index, invalid key)""" class ColumnDoesNotExist(Exception): - """Raised when the user supplies a column index or column key which does - not exist in the DataTable (e.g. out of bounds index, invalid key)""" + """Raised when the column index or column key provided does not exist + in the DataTable (e.g. out of bounds index, invalid key)""" class DuplicateKey(Exception): diff --git a/src/textual/widgets/data_table.py b/src/textual/widgets/data_table.py index 0bb18f87f..a5eea1354 100644 --- a/src/textual/widgets/data_table.py +++ b/src/textual/widgets/data_table.py @@ -1,5 +1,3 @@ -"""Make non-widget DataTable support classes available.""" - from ._data_table import ( CellDoesNotExist, CellKey,