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.3.tar.gz
(27.5 kB
view hashes)
Built Distribution
rstobj-0.0.3-py2.py3-none-any.whl
(65.5 kB
view hashes)
Close
Hashes for rstobj-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2634da521878500faf9dc2685a2522ce60618941dfe5cbc0c16b9b0eaa88f92b |
|
MD5 | 8cbdc9d736f69075f07123d34db3f9e6 |
|
BLAKE2b-256 | c09fa31c7f6c2a0075aebd6edda5dce53fa2e32316622b1e97f4441c16245a37 |