📝 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:
Gabriel Luiz Freitas Almeida 2023-06-24 16:32:00 -03:00
commit 2de86cbac4

View file

@ -15,14 +15,21 @@ class FrontendNode(BaseModel):
base_classes: List[str]
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:
"""Returns a dict representation of the frontend node."""
return {
self.name: {
"template": self.template.to_dict(self.format_field),
"description": self.description,
"base_classes": self.base_classes,
"display_name": self.display_name or self.name,
"documentation": self.documentation,
},
}