Add :type: option for rst:directive:option directive

This commit is contained in:
Takeshi KOMIYA
2019-04-16 22:32:51 +09:00
parent 4307dec3ac
commit ca605c7437
3 changed files with 42 additions and 2 deletions

View File

@@ -95,6 +95,21 @@ def test_rst_directive_option_with_argument(app):
domain="rst", objtype="directive:option", noindex=False)
def test_rst_directive_option_type(app):
text = (".. rst:directive:option:: foo\n"
" :type: directives.flags\n")
doctree = restructuredtext.parse(app, text)
assert_node(doctree, (addnodes.index,
[desc, ([desc_signature, ([desc_name, ":foo:"],
[desc_annotation, " (directives.flags)"])],
[desc_content, ()])]))
assert_node(doctree[0],
entries=[("single", ":foo: (directive option)",
"directive:option--foo", "", "F")])
assert_node(doctree[1], addnodes.desc, desctype="directive:option",
domain="rst", objtype="directive:option", noindex=False)
def test_rst_directive_and_directive_option(app):
text = (".. rst:directive:: foo\n"
"\n"