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.1.tar.gz
(19.6 kB
view hashes)
Built Distribution
rstobj-0.0.1-py2.py3-none-any.whl
(46.3 kB
view hashes)
Close
Hashes for rstobj-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acaf5b7f0d02c69c41c86af2b2df2435d9ff9c5d47b6508760612fa30c1cc743 |
|
MD5 | cf2607717f6f66d41d04a3afe66a957a |
|
BLAKE2b-256 | 01511323f46d35cd5a6457d424f5504175e9f476d15ba439a97c504ed492a4fc |