nbprint.config.content.Content¶
- pydantic model nbprint.config.content.Content[source]¶
Bases:
BaseModel- field content: str | list[Annotated[BaseModel, SerializeAsAny()]] | None = ''¶
- field tags: list[str] [Optional]¶
- field role: Role = Role.CONTENT¶
- field magics: list[str] | None [Optional]¶
List of cell magics to apply to the cell
- field output: str | None = None¶
If set, the cell’s outputs will be collected into the Outputs context under this key (only for code cells).
- field style: Style | None = None¶
- render(**kwargs) None[source]¶
Called during notebook generation only, this should run any necessary post-processing. Pre-processing should go in __init__
- generate(metadata: dict | None = None, config: Configuration | None = None, parent: BaseModel | None = None, attr: str = '', counter: int | None = None) NotebookNode | list[NotebookNode] | None[source]¶
Generate a notebook node for this model. This will be called before the runtime of the notebook, use it for code generation.
Args:¶
metadata (dict): common cell metadata
Returns:¶
NotebookNode: the content of the notebook node
- Content.convert_content_from_obj[source]