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.

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)

Source distribution for sphinxcontrib.datatemplates 0.11.0
File Size Uploaded
sphinxcontrib.datatemplates-0.11.0.tar.gz 31.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinxcontrib.datatemplates 0.11.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.11.0 This release

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

0.8.1

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