docs/util: Cells now have properties
Properties are both an option: ``` .. cell:def:: $add :properties: is_evaluable ``` and a field: ``` .. cell:def:: $eqx :property x-aware: :property is_evaluable: ``` Properties as an option appear in the property index: linking a given property to all cells with that property; while properties as a field display with the cell.
This commit is contained in:
@@ -33,7 +33,7 @@ class YosysCell:
|
||||
code: str
|
||||
inputs: list[str]
|
||||
outputs: list[str]
|
||||
properties: dict[str, bool]
|
||||
properties: list[str]
|
||||
|
||||
class YosysCellGroupDocumenter(Documenter):
|
||||
objtype = 'cellgroup'
|
||||
@@ -298,11 +298,22 @@ class YosysCellDocumenter(YosysCellGroupDocumenter):
|
||||
self.add_line(f'.. {domain}:{directive}:: {sig}', sourcename)
|
||||
|
||||
# options
|
||||
opt_attrs = ["title", ]
|
||||
opt_attrs = ["title", "properties", ]
|
||||
for attr in opt_attrs:
|
||||
val = getattr(cell, attr, None)
|
||||
if isinstance(val, list):
|
||||
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)
|
||||
|
||||
if self.options.noindex:
|
||||
self.add_line(' :noindex:', sourcename)
|
||||
|
||||
Reference in New Issue
Block a user