Construct RestructuredText markup and directives from Python Code.
Project description
Welcome to rstobj Documentation
rstobj is a library that construct Restructured Text markup or directives from Python Code. rstobj is based on jinja2.
Example:
import rstobj
ltable = rstobj.directives.ListTable(
data=[["id", "name"], [1, "Alice"], [2, "Bob"]],
title="Users",
header=True,
)
rst = ltable.render()
print(rst)
Output:
.. list-table:: Users :header-rows: 1 :stub-columns: 0 * - id - name * - 1 - Alice * - 2 - Bob
I recommend to use this in your jinja2 template, outut.rst:
{{ ltable.render() }}
Install
rstobj is released on PyPI, so all you need is:
$ pip install rstobj
To upgrade to latest version:
$ pip install --upgrade rstobj
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
rstobj-0.0.4.tar.gz
(28.9 kB
view hashes)
Built Distribution
rstobj-0.0.4-py2.py3-none-any.whl
(69.0 kB
view hashes)
Close
Hashes for rstobj-0.0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709bba2e12b522a9c45608cb1b24284b092cc4fa60501b5eed998a14a3fc4688 |
|
MD5 | 55cdc6735d1f686d88f4ed79d04f185c |
|
BLAKE2b-256 | c753efc9e15bce7d5969a78a7f61219779892e2b5e029b90a13b90b51ab28bd4 |