在重组文本中将长列表分成多列
break a long list into multiple columns in restructured text
有没有办法在重组文本中将长列表分成多列?
来源:
* a
* b
* c
* d
* e
* a
* c
* a
* d
* e
* f
结果:
* a * e * d
* b * a * e
* c * c * f
* d * a
目标是在 reST 指令中提供源列表
而不是使用其他语言读取源列表,然后在 reST 中使用“.. raw::”指令写入结果文本。例如这个假设的 list-multicol
指令:
.. list-multicol::
:columns: 3
* a
* b
* c
* d
* e
* a
* c
* a
* d
* e
* f
平衡列(相同数量的项目 +/- 1)不超过页面宽度或指定列数的选项的额外信用。
显然,hlist
指令就是这样做的。
http://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-hlist
示例如下:
.. hlist::
:columns: 3
* A list of
* short items
* that should be
* displayed
* horizontally
有没有办法在重组文本中将长列表分成多列?
来源:
* a
* b
* c
* d
* e
* a
* c
* a
* d
* e
* f
结果:
* a * e * d
* b * a * e
* c * c * f
* d * a
目标是在 reST 指令中提供源列表
而不是使用其他语言读取源列表,然后在 reST 中使用“.. raw::”指令写入结果文本。例如这个假设的 list-multicol
指令:
.. list-multicol::
:columns: 3
* a
* b
* c
* d
* e
* a
* c
* a
* d
* e
* f
平衡列(相同数量的项目 +/- 1)不超过页面宽度或指定列数的选项的额外信用。
显然,hlist
指令就是这样做的。
http://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-hlist
示例如下:
.. hlist::
:columns: 3
* A list of
* short items
* that should be
* displayed
* horizontally