fabricatio_typst.models.article_main

ArticleBase and ArticleSubsection classes for managing hierarchical document components.

Attributes

PARAGRAPH_SEP

Classes

Paragraph

Structured academic paragraph blueprint for controlled content generation.

ArticleParagraphSequencePatch

Patch for Paragraph list of ArticleSubsection.

ArticleSubsection

Atomic argumentative unit with technical specificity.

ArticleSection

Atomic argumentative unit with high-level specificity.

ArticleChapter

Thematic progression implementing research function.

Article

Represents a complete academic paper specification, incorporating validation constraints.

Module Contents

fabricatio_typst.models.article_main.PARAGRAPH_SEP
class fabricatio_typst.models.article_main.Paragraph(/, **data: Any)

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

Structured academic paragraph blueprint for controlled content generation.

expected_word_count: pydantic.NonNegativeInt = 0

The expected word count of this paragraph, 0 means not specified

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.

aims: List[str]

Specific communicative objectives for this paragraph’s content.

content: str

The actual content of the paragraph, represented as a string.

classmethod from_content(content: str) Self

Create a Paragraph object from the given content.

property exact_word_count: int

Calculates the exact word count of the content.

class fabricatio_typst.models.article_main.ArticleParagraphSequencePatch

Bases: fabricatio_capabilities.models.generic.SequencePatch[Paragraph]

Patch for Paragraph list of ArticleSubsection.

class fabricatio_typst.models.article_main.ArticleSubsection

Bases: fabricatio_typst.models.article_base.SubSectionBase

Atomic argumentative unit with technical specificity.

paragraphs: List[Paragraph]

List of Paragraph objects containing the content of the subsection.

property exact_word_count: int

Calculates the exact word count of all paragraphs in the subsection.

property word_count: int

Calculates the total word count of all paragraphs in the subsection.

introspect() str

Introspects the subsection and returns a summary of its state.

update_from_inner(other: Self) Self

Updates the current instance with the attributes of another instance.

to_typst_code() str

Converts the component into a Typst code snippet for rendering.

Returns:

Typst code snippet for rendering.

Return type:

str

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

Creates an Article object from the given Typst code.

class fabricatio_typst.models.article_main.ArticleSection

Bases: fabricatio_typst.models.article_base.SectionBase[ArticleSubsection]

Atomic argumentative unit with high-level specificity.

child_type: ClassVar[Type[fabricatio_typst.models.article_base.SubSectionBase]]
class fabricatio_typst.models.article_main.ArticleChapter

Bases: fabricatio_typst.models.article_base.ChapterBase[ArticleSection]

Thematic progression implementing research function.

child_type: ClassVar[Type[fabricatio_typst.models.article_base.SectionBase]]
class fabricatio_typst.models.article_main.Article

Bases: fabricatio_typst.models.generic.WithRef[fabricatio_typst.models.article_outline.ArticleOutline], fabricatio_capabilities.models.generic.PersistentAble, fabricatio_typst.models.article_base.ArticleBase[ArticleChapter]

Represents a complete academic paper specification, incorporating validation constraints.

This class integrates display, censorship processing, article structure referencing, and persistence capabilities, aiming to provide a comprehensive model for academic papers.

child_type: ClassVar[Type[fabricatio_typst.models.article_base.ChapterBase]]
convert_tex(paragraphs: bool = True, descriptions: bool = True) Self

Convert tex to typst code.

iter_subsections() Generator[Tuple[ArticleChapter, ArticleSection, ArticleSubsection], None, None]
extrac_outline() fabricatio_typst.models.article_outline.ArticleOutline

Extract outline from article.

classmethod from_outline(outline: fabricatio_typst.models.article_outline.ArticleOutline) Article

Generates an article from the given outline.

Parameters:

outline (ArticleOutline) – The outline to generate the article from.

Returns:

The generated article.

Return type:

Article

classmethod from_mixed_source(article_outline: fabricatio_typst.models.article_outline.ArticleOutline, typst_code: str) Self

Generates an article from the given outline and Typst code.

async edit_titles() Self

Edits the titles of the article.

check_short_paragraphs(threshold: int = 60) str

Checks for short paragraphs in the article.