Sphinx directives for CSV-powered tabular authoring.
Project description
sphinx-tabular
Instead of just modifying the final table output, sphinx-tabular builds real docutils table nodes (table/tgroup/row/entry) the same way docutils' own table directives do, and only overrides the HTML rendering of table cells (for colspan/rowspan/inline styling) — the rest of the output is generated by Sphinx's normal HTML writer.
While the table structure and merged cells will work in the LaTeX builder PDF output, the table formatting (colors, icons, bacgkround color, text color, and alignment) is HTML only.
Donations to help support this project...
Features
- Sphinx extension.
- Uses standard CSV file format.
- Easily merge table cells with
<and^. - Support reStructuredText and Markdown.
- Support for inline table data and external files.
- Optional sticky header support for one or more header rows.
- Provides a minimal set of spreadsheet formulas.
- Set table cell alignment and per-cell alignment in both horizontal and vertical directions.
- Set custom cell text and background colors.
- Custom status pill.
- Support for Font Awesome and Bootstrip icons if installed by your theme.
- Sortable rows by clicking on the header row.
- Searchable option.
Installation
pip install sphinx-tabular
conf.py
bash extensions = [ ..., 'sphinx_tabular', ..., ]
Directives
RST, external file:
RST .. rcsv-table:: Title :file: table.rcsv
RST, inline data.
``RST .. rcsv-table:: Title
Col 1, Row 1
Col 2, Row 2
``
Markdown, external file:
RST .. rcsv-table:: Title :file: table.mcsv
Markdown, inline data.
``RST .. rcsv-table:: Title
Col 1, Row 1
Col 2, Row 2
``
Merging Cells
Columns
``RST .. rcsv-table:: Title
Merged,<
Unmerged, Unmerged
``
Rows
``RST .. rcsv-table:: Title
Merged,Unmerged
^, Unmerged
``
Options
Supported options include:
:file:Path to the.rcsvor.mcsvfile.:header-rows:Number of top rows to format as header rows. If:sticky-header:is set, these rows become sticky.:width:CSS width for the table, such as100%.:widths:A space-separated list of column widths.:class:Additional classes to add to the table.:text-align:Horizontal alignment of text in the cells. Default isleft.:vertical-align:Vertical alignment of text in cells. Default ismiddle.:sticky-header:Make the header rows sticky when scrolling long tables.:sticky-offset:CSS offset for sticky headers, such as3.5rem.:strict:Treat ragged rows and malformed input as errors instead of warnings.:sortable:Enable row sorting by clicking on the headers.:search:Add a search field with a row count to the table and enable searching.:sort-types:Assigns explicit sort types usingCOLUMN=TYPEentries.
Formatting
- Custom theming.
=ALIGN()horizontal/vertical cell value alignment.=BG()set the background cell color.=FG()set text color.=ICON()use a Font Awesome or Bootstrap icon, or a fallback.=STATUS()insert a colored status pill.
Spreadsheet
'interprest as literal text without evaluation.+,-,*,/arithmetic operations on cells.=C4cell references.=A4:B4cell ranges.=AVG()take the average.=CONCAT()concatenation of cell values.=COUNT()count number of numerical values.=IF()conditional evaluation.=MAX()find the maximum value.=MIN()find the minimum value.=ROUND()round the number to an int or the specified decimal places.=SUM()sum a set or range of values.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx_tabular-0.2.3.tar.gz.
File metadata
- Download URL: sphinx_tabular-0.2.3.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8abd62f5989759423beca74e029b4f68d5c00c0150c6dc985ed0ad9cdf37c55
|
|
| MD5 |
82c45df1d96f399b4d4462bf5c13c3e8
|
|
| BLAKE2b-256 |
800a3638c4e7b0b9f70e334fc0a9de8827d61257ada2d31dd18c741d819b2fa1
|
Provenance
The following attestation bundles were made for sphinx_tabular-0.2.3.tar.gz:
Publisher:
publish.yml on deepthinker2001/sphinx-tabular
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_tabular-0.2.3.tar.gz -
Subject digest:
c8abd62f5989759423beca74e029b4f68d5c00c0150c6dc985ed0ad9cdf37c55 - Sigstore transparency entry: 2141049734
- Sigstore integration time:
-
Permalink:
deepthinker2001/sphinx-tabular@f21a5a1e1d442ee2d83e28661ecab31fb639f4f8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deepthinker2001
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f21a5a1e1d442ee2d83e28661ecab31fb639f4f8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sphinx_tabular-0.2.3-py3-none-any.whl.
File metadata
- Download URL: sphinx_tabular-0.2.3-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db5bc618b10418978c67a77e493752dcaaac66aa80829ba24c38f5ef87972ccb
|
|
| MD5 |
e8c99a7f94988a3022459db1860f722e
|
|
| BLAKE2b-256 |
87aa16ffd0918d7b7d608969eb2aa64536b4bb2ead3fdb8f0bca9371f0daee42
|
Provenance
The following attestation bundles were made for sphinx_tabular-0.2.3-py3-none-any.whl:
Publisher:
publish.yml on deepthinker2001/sphinx-tabular
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_tabular-0.2.3-py3-none-any.whl -
Subject digest:
db5bc618b10418978c67a77e493752dcaaac66aa80829ba24c38f5ef87972ccb - Sigstore transparency entry: 2141049763
- Sigstore integration time:
-
Permalink:
deepthinker2001/sphinx-tabular@f21a5a1e1d442ee2d83e28661ecab31fb639f4f8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deepthinker2001
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f21a5a1e1d442ee2d83e28661ecab31fb639f4f8 -
Trigger Event:
workflow_dispatch
-
Statement type: