Skip to main content

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.

Metadata

Release files for sphinxcontrib.datatemplates 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxcontrib.datatemplates 0.8.1
File Size Uploaded
sphinxcontrib.datatemplates-0.8.1.tar.gz 27.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinxcontrib.datatemplates 0.8.1
File Interpreter ABI Platform
sphinxcontrib.datatemplates-0.8.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 41.5 kB

Release files / sphinxcontrib.datatemplates-0.8.1.tar.gz

Download URL sphinxcontrib.datatemplates-0.8.1.tar.gz
Size 27.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3035e2f9ed20ef013556da3a9f166f89c1f433ff9839cba798f96b41461ce5be
BLAKE2b-256 checksum
How to use checksums
c6c64aad59f960eadac920a21b6742251a922a8b4f33ad1bf7bb1d8030448f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

Release files / sphinxcontrib.datatemplates-0.8.1-py2.py3-none-any.whl

Download URL sphinxcontrib.datatemplates-0.8.1-py2.py3-none-any.whl
Size 13.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0e20398784509a19815e7a9254f515839c8e312aba5602b3b94f419856791822
BLAKE2b-256 checksum
How to use checksums
0af776c1ea29425485c950d6d6d7a35c4098389103cf66965f28a6d535c0d245
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

Release history Release notifications | RSS feed

0.11.0

2 release files

0.10.2

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

This release

0.8.1 This release

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

1 release file

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page