def write_dl(self, rows, col_max=30, col_spacing=2):
"""Writes a definition list into the buffer. This is how options
and commands are usually formatted.
:param rows: a list of two item tuples for the terms and values.
:param col_max: the maximum width of the first column.
:param col_spacing: the number of spaces between the first and
second column.
"""
rows = list(rows)
dl = nodes.bullet_list()
self._node.append(dl)
for (option, help_text) in rows:
item = nodes.list_item()
dl.append(item)
p = nodes.paragraph()
p.append(nodes.literal('', option))
p.append(nodes.Text(': '))
p.append(nodes.Text(help_text))
item.append(p)
评论列表
文章目录