Revision 12637df5 lib/build/sphinx_ext.py
b/lib/build/sphinx_ext.py | ||
---|---|---|
270 | 270 |
@type fields: dict (field name as key, field details as value) |
271 | 271 |
|
272 | 272 |
""" |
273 |
for (_, (fdef, _, _, _)) in utils.NiceSort(fields.items(), |
|
274 |
key=compat.fst): |
|
275 |
assert len(fdef.doc.splitlines()) == 1 |
|
276 |
yield "``%s``" % fdef.name |
|
277 |
yield " %s" % fdef.doc |
|
273 |
defs = [(fdef.name, fdef.doc) |
|
274 |
for (_, (fdef, _, _, _)) in utils.NiceSort(fields.items(), |
|
275 |
key=compat.fst)] |
|
276 |
yield BuildValuesDoc(defs) |
|
277 |
|
|
278 |
|
|
279 |
def BuildValuesDoc(values): |
|
280 |
"""Builds documentation for a list of values |
|
281 |
|
|
282 |
@type values: list of tuples in the form (value, documentation) |
|
283 |
|
|
284 |
""" |
|
285 |
for name, doc in values: |
|
286 |
assert len(doc.splitlines()) == 1 |
|
287 |
yield "``%s``" % name |
|
288 |
yield " %s" % doc |
|
278 | 289 |
|
279 | 290 |
|
280 | 291 |
# TODO: Implement Sphinx directive for query fields |
Also available in: Unified diff