📝 docs(frontend_node): add set_documentation method to set the documentation of the frontend node
✨ feat(frontend_node): add documentation field to the frontend node dict representation
The `set_documentation` method is added to the `FrontendNode` class to allow setting the documentation of the frontend node. The `to_dict` method is updated to include the `documentation` field in the dict representation of the frontend node. This improves the readability and usability of the frontend node by providing documentation for the node.
This commit is contained in:
parent
08cdc15d98
commit
2de86cbac4
1 changed files with 7 additions and 0 deletions
|
|
@ -15,14 +15,21 @@ class FrontendNode(BaseModel):
|
||||||
base_classes: List[str]
|
base_classes: List[str]
|
||||||
name: str = ""
|
name: str = ""
|
||||||
display_name: str = ""
|
display_name: str = ""
|
||||||
|
documentation: str = ""
|
||||||
|
|
||||||
|
def set_documentation(self, documentation: str) -> None:
|
||||||
|
"""Sets the documentation of the frontend node."""
|
||||||
|
self.documentation = documentation
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
|
"""Returns a dict representation of the frontend node."""
|
||||||
return {
|
return {
|
||||||
self.name: {
|
self.name: {
|
||||||
"template": self.template.to_dict(self.format_field),
|
"template": self.template.to_dict(self.format_field),
|
||||||
"description": self.description,
|
"description": self.description,
|
||||||
"base_classes": self.base_classes,
|
"base_classes": self.base_classes,
|
||||||
"display_name": self.display_name or self.name,
|
"display_name": self.display_name or self.name,
|
||||||
|
"documentation": self.documentation,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue