This package contains sphinxcontrb.datatemplates, an extension for Sphinx to render parts of reStructuredText pages from data files in formats like JSON, YAML, and CSV.
Sample YAML Input
---
key1: value1
key2:
- list item 1
- list item 2
- list item 3
nested-list:
- ['a', 'b', 'c']
- ['A', 'B', 'C']
mapping-series:
- cola: a
colb: b
colc: c
- cola: A
colb: B
colc: C
Sample Template
.. -*- mode: rst -*-
Individual Item
~~~~~~~~~~~~~~~
{{ data['key1'] }}
List of Items
~~~~~~~~~~~~~
{% for item in data['key2'] %}
- {{item}}
{% endfor %}
Nested List Table
~~~~~~~~~~~~~~~~~
Rendering a table from a list of nested sequences using hard-coded
headers.
{{ make_list_table(
['One', 'Two', 'Three'],
data['nested-list'],
title='Table from nested lists',
) }}
Mapping Series Table
~~~~~~~~~~~~~~~~~~~~
Rendering a table from a list of nested dictionaries using dynamic
headers.
{{ make_list_table_from_mappings(
[('One', 'cola'), ('Two', 'colb'), ('Three', 'colc')],
data['mapping-series'],
title='Table from series of mappings',
) }}
Rendered Output
See the sphinx output online.
Release files for sphinxcontrib.datatemplates 0.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sphinxcontrib.datatemplates-0.11.0.tar.gz | 31.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinxcontrib.datatemplates-0.11.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.5 kB
Release files / sphinxcontrib.datatemplates-0.11.0.tar.gz
| Download URL | sphinxcontrib.datatemplates-0.11.0.tar.gz |
|---|---|
| Size | 31.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
793222e803430076341509cc167f8d715830b05e418c885313101d60fd442557
|
|
BLAKE2b-256 checksum How to use checksums |
b99e8ac54a6a3e7a00339f417568899b64a0c0d622429db73cc1a28c8122c8e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / sphinxcontrib.datatemplates-0.11.0-py3-none-any.whl
| Download URL | sphinxcontrib.datatemplates-0.11.0-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88d02f5edab32b88211ebb72a90553e3676a5737877bad1de412f84058ac282e
|
|
BLAKE2b-256 checksum How to use checksums |
d48d7a7dd95ad1eedec8dc770570c8b1f3dc1d13357383635607b6629ccf329c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|