gwin.utils.sphinx module¶
Sphinx/RST for GWIn
-
gwin.utils.sphinx.
rst_dict_table
(dict_, key_format=<type 'str'>, val_format=<type 'str'>, header=None)[source]¶ Returns an RST-formatted table of keys and values from a
dict
Parameters: Examples
>>> a = {'key1': 'value1', 'key2': 'value2'} >>> print(rst_dict_table(a)) ==== ====== key1 value1 key2 value2 ==== ====== >>> print(rst_dict_table(a, key_format='``{}``'.format, ... val_format=':class:`{}`'.format, ... header=('Key', 'Value')) ======== =============== Key Value ======== =============== ``key1`` :class:`value1` ``key2`` :class:`value2` ======== ===============