mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
Accept rst syntax in .. statement:: short: text
Nested rst syntax is now parsed and rendered. E.g.: .. namedconf:statement:: example :short: Use ``this`` **cool** syntax!
This commit is contained in:
@@ -114,10 +114,18 @@ def domain_factory(domainname, domainlabel, todolist):
|
|||||||
def isc_short(self):
|
def isc_short(self):
|
||||||
return self.options.get("short", "")
|
return self.options.get("short", "")
|
||||||
|
|
||||||
|
def parse_nested_str(self, instr):
|
||||||
|
"""Parse string as nested rst syntax and produce a node"""
|
||||||
|
raw = nodes.paragraph(text=instr)
|
||||||
|
parsed = nodes.paragraph()
|
||||||
|
self.state.nested_parse(raw, self.content_offset, parsed)
|
||||||
|
return parsed
|
||||||
|
|
||||||
def transform_content(self, contentnode: addnodes.desc_content) -> None:
|
def transform_content(self, contentnode: addnodes.desc_content) -> None:
|
||||||
"""autogenerate content from structured data"""
|
"""autogenerate content from structured data"""
|
||||||
if self.isc_short:
|
if self.isc_short:
|
||||||
contentnode.insert(0, nodes.paragraph(text=self.isc_short))
|
short_parsed = self.parse_nested_str(self.isc_short)
|
||||||
|
contentnode.insert(0, short_parsed)
|
||||||
if self.isc_tags:
|
if self.isc_tags:
|
||||||
tags = nodes.paragraph()
|
tags = nodes.paragraph()
|
||||||
tags += nodes.strong(text="Tags: ")
|
tags += nodes.strong(text="Tags: ")
|
||||||
|
Reference in New Issue
Block a user