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
中的值填充。