signode["ids"].append(domainname + "-statement-" + sig)
iscconf = self.env.get_domain(domainname)
- iscconf.add_statement(sig, self.isc_tags, self.isc_short, self.lineno)
+ iscconf.add_statement(
+ sig, self.isc_tags, self.isc_short, self.isc_short_node, self.lineno
+ )
@property
def isc_tags(self):
def isc_short(self):
return self.options.get("short", "")
+ @property
+ def isc_short_node(self):
+ """Short description parsed from rst to docutils node"""
+ return self.parse_nested_str(self.isc_short)
+
def format_path(self, path):
assert path[0] == "_top"
if len(path) == 1:
def transform_content(self, contentnode: addnodes.desc_content) -> None:
"""autogenerate content from structured data"""
if self.isc_short:
- short_parsed = self.parse_nested_str(self.isc_short)
- contentnode.insert(0, short_parsed)
+ contentnode.insert(0, self.isc_short_node)
if self.isc_tags:
tags = nodes.paragraph()
tags += nodes.strong(text="Tags: ")
def get_statement_name(self, signature):
return "{}.{}.{}".format(domainname, "statement", signature)
- def add_statement(self, signature, tags, short, lineno):
+ def add_statement(self, signature, tags, short, short_node, lineno):
"""
Add a new statement to the domain data structures.
No visible effect.
new = {
"tags": tags,
"short": short,
+ "short_node": short_node,
"filename": self.env.doc2path(self.env.docname),
"lineno": lineno,
# Sphinx API
def gen_replacement_table(acceptable_blocks, acceptable_tags):
table_header = [
TableColumn("ref", "Statement"),
- TableColumn("short", "Description"),
+ TableColumn("short_node", "Description"),
]
tag_header = []
if len(acceptable_tags) != 1:
value = obj[column.dictkey]
if isinstance(value, str):
value = nodes.Text(value)
+ else:
+ value = value.deepcopy()
entry += value
row += entry
self.tbody.append(row)