demo

This module is a sphinx-doc add-on to implement the following markup:

.. icontable:: <dirname>
    :n_columns: <n_columns>

For example:

.. icontable:: demo-images
    :n_columns: 3

It looks for image file in <currend_dir>/<dirname>, and put them into a rst list table, <n_columns> item each row.

rstobj.demo.grouper(iterable, n, fillvalue=None)[source]

Collect data into fixed-length chunks or blocks.

Example:

>>> list(grouper(range(10), n=3, fillvalue=None))
[(0, 1, 2), (3, 4, 5), (6, 7, 8), (9, None, None)]

中文文档

将一个序列按照尺寸n, 依次打包输出, 如果元素不够n的包, 则用 fillvalue 中的值填充。

rstobj.demo.derive_rst(current_dir, image_dir, n_columns)[source]

scan image_dir find all image path, find the relative path to current_dir, and put them in a table, n_columns width. return the list table rst directive text.

class rstobj.demo.IconTable(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

.. icontable:: <dirpath> markup implementation.