fabricatio_typst.models.meta

Lightweight metadata model and Typst code mixins for article components.

Attributes

RefKey

Classes

ReferringType

Enumeration of different types of references that can be made in an article.

ArticleMetaData

Metadata for an article component.

FromTypstCode

Base class for article components that can be created from a Typst code snippet.

ToTypstCode

Base class for article components that can be converted to a Typst code snippet.

Module Contents

class fabricatio_typst.models.meta.ReferringType

Bases: enum.StrEnum

Enumeration of different types of references that can be made in an article.

CHAPTER = 'chapter'
SECTION = 'section'
SUBSECTION = 'subsection'
type fabricatio_typst.models.meta.RefKey = Tuple[str, str | None, str | None]
class fabricatio_typst.models.meta.ArticleMetaData(/, **data: Any)

Bases: fabricatio_core.models.generic.SketchedAble, fabricatio_core.models.generic.Described, fabricatio_capabilities.models.generic.WordCount, fabricatio_core.models.generic.Titled, fabricatio_core.models.generic.Language

Metadata for an article component.

description: str = None

A comprehensive description of this object, including its purpose, scope, and context. This should clearly explain what this object is about, why it exists, and in what situations it applies. The description should be detailed enough to provide full understanding of this object’s intent and application.

title: str = None

The title of this object, make it professional and concise.No prefixed heading number should be included.

aims: List[str]

List of writing aims of the research component in academic style.

property typst_metadata_comment: str

Generates a comment for the metadata of the article component.

property unstructured_body: str

Returns the unstructured body of the article component.

update_unstructured_body[S: ArticleMetaData](body: str) S

Update the unstructured body of the article component.

property language: str

Get the language of the article component.

class fabricatio_typst.models.meta.FromTypstCode(/, **data: Any)

Bases: ArticleMetaData, abc.ABC

Base class for article components that can be created from a Typst code snippet.

classmethod from_typst_code(title: str, body: str, **kwargs) Self

Converts a Typst code snippet into an article component.

class fabricatio_typst.models.meta.ToTypstCode(/, **data: Any)

Bases: ArticleMetaData, abc.ABC

Base class for article components that can be converted to a Typst code snippet.

to_typst_code() str

Converts the component into a Typst code snippet for rendering.