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.2.tar.gz
(26.7 kB
view hashes)
Built Distribution
rstobj-0.0.2-py2.py3-none-any.whl
(63.3 kB
view hashes)
Close
Hashes for rstobj-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10eb58d3cb1d420acc8540549cdf8af808636d4dd5b612a1216d93d5a7b59413 |
|
MD5 | 9aeaca322a8f26a3434cde1daead88df |
|
BLAKE2b-256 | 44a1e77886c9673602080b6096d26519d010a47a96ff51c357fe74426242865d |