Sphinx扩展,用于将数据文件渲染为漂亮的HTML
项目描述
此软件包包含 sphinxcontrib.datatemplates,这是一个Sphinx扩展,用于将reStructuredText页面的一部分从JSON、YAML和CSV等格式的数据文件中渲染出来。
样本YAML输入
--- key1: value1 key2: - list item 1 - list item 2 - list item 3 nested-list: - ['a', 'b', 'c'] - ['A', 'B', 'C'] mapping-series: - cola: a colb: b colc: c - cola: A colb: B colc: C
样本模板
.. -*- mode: rst -*- Individual Item ~~~~~~~~~~~~~~~ {{ data['key1'] }} List of Items ~~~~~~~~~~~~~ {% for item in data['key2'] %} - {{item}} {% endfor %} Nested List Table ~~~~~~~~~~~~~~~~~ Rendering a table from a list of nested sequences using hard-coded headers. {{ make_list_table( ['One', 'Two', 'Three'], data['nested-list'], title='Table from nested lists', ) }} Mapping Series Table ~~~~~~~~~~~~~~~~~~~~ Rendering a table from a list of nested dictionaries using dynamic headers. {{ make_list_table_from_mappings( [('One', 'cola'), ('Two', 'colb'), ('Three', 'colc')], data['mapping-series'], title='Table from series of mappings', ) }}
渲染输出
在线查看 sphinx输出。
项目详细信息
关闭
哈希值 for sphinxcontrib.datatemplates-0.11.0-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 88d02f5edab32b88211ebb72a90553e3676a5737877bad1de412f84058ac282e |
|
MD5 | 0719590012e62d6de023f6ff6faac36f |
|
BLAKE2b-256 | d48d7a7dd95ad1eedec8dc770570c8b1f3dc1d13357383635607b6629ccf329c |