nbprint.config.content.Content

pydantic model nbprint.config.content.Content[source]

Bases: BaseModel

field content: str | Annotated[list[Annotated[BaseModel, SerializeAsAny()]], SerializeAsAny()] | None = ''
field tags: Annotated[list[str], SerializeAsAny()] [Optional]
field role: Role = Role.CONTENT
field magics: Annotated[list[str], SerializeAsAny()] | 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: Annotated[Style, SerializeAsAny()] | None = None
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]