mirror of https://github.com/YosysHQ/yosys.git
Docs: Render cell titles
Also put property lists *after* cell description.
This commit is contained in:
parent
7216f07691
commit
927dc445dd
|
@ -4,8 +4,6 @@
|
|||
Binary operators
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
.. TODO:: display cell titles
|
||||
|
||||
All binary RTL cells have two input ports ``A`` and ``B`` and one output port
|
||||
``Y``. They also have the following parameters:
|
||||
|
||||
|
|
|
@ -305,15 +305,8 @@ class YosysCellDocumenter(YosysCellGroupDocumenter):
|
|||
val = ' '.join(val)
|
||||
if val:
|
||||
self.add_line(f' :{attr}: {val}', sourcename)
|
||||
|
||||
self.add_line('\n', sourcename)
|
||||
|
||||
# fields
|
||||
field_attrs = ["properties", ]
|
||||
for field in field_attrs:
|
||||
attr = getattr(cell, field, [])
|
||||
for val in attr:
|
||||
self.add_line(f' :{field} {val}:', sourcename)
|
||||
self.add_line('\n', sourcename)
|
||||
|
||||
if self.options.noindex:
|
||||
self.add_line(' :noindex:', sourcename)
|
||||
|
@ -331,6 +324,14 @@ class YosysCellDocumenter(YosysCellGroupDocumenter):
|
|||
for line, src in zip(more_content.data, more_content.items):
|
||||
self.add_line(line, src[0], src[1])
|
||||
|
||||
# fields
|
||||
self.add_line('\n', sourcename)
|
||||
field_attrs = ["properties", ]
|
||||
for field in field_attrs:
|
||||
attr = getattr(self.object, field, [])
|
||||
for val in attr:
|
||||
self.add_line(f':{field} {val}:', sourcename)
|
||||
|
||||
def get_object_members(
|
||||
self,
|
||||
want_all: bool
|
||||
|
|
|
@ -209,6 +209,14 @@ class CellNode(TocNode):
|
|||
self.env.docname,
|
||||
idx,
|
||||
0))
|
||||
|
||||
def transform_content(self, contentnode: addnodes.desc_content) -> None:
|
||||
# Add the cell title to the body
|
||||
if 'title' in self.options:
|
||||
titlenode = nodes.paragraph()
|
||||
titlenode += nodes.strong()
|
||||
titlenode[-1] += nodes.Text(self.options['title'])
|
||||
contentnode.insert(0, titlenode)
|
||||
|
||||
class CellSourceNode(TocNode):
|
||||
"""A custom code block for including cell source."""
|
||||
|
|
Loading…
Reference in New Issue