fabricatio_novel.rust

Classes

NovelBuilder

A Python-exposed builder for creating EPUB novels.

Functions

text_to_xhtml_paragraphs(→ str)

Package Contents

class fabricatio_novel.rust.NovelBuilder

A Python-exposed builder for creating EPUB novels.

new_novel() NovelBuilder

Initializes a new EPUB novel builder.

set_title(title: str) NovelBuilder
set_description(description: str) NovelBuilder

Sets the novel description.

add_author(author: str) NovelBuilder

Adds an author to the novel metadata.

add_chapter(title: str, content: str) NovelBuilder

Adds a chapter with given title and content.

add_cover_image(path: str | os.PathLike | pathlib.Path, source: str | os.PathLike | pathlib.Path) NovelBuilder

Adds a cover image from the given file path.

add_metadata(key: str, value: str) NovelBuilder

Adds custom metadata key-value pair to the novel.

add_css(css: str) NovelBuilder

Adds CSS styles to the novel.

add_resource(path: str | os.PathLike | pathlib.Path, source: str | os.PathLike | pathlib.Path) NovelBuilder

Adds a resource file to the novel.

add_font(font_family: str, source: str | os.PathLike | pathlib.Path) NovelBuilder

Adds a font file to the novel.

add_inline_toc() NovelBuilder

Enables inline table of contents generation.

export(path: str | os.PathLike | pathlib.Path) NovelBuilder

Exports the built novel to the specified file path.

fabricatio_novel.rust.text_to_xhtml_paragraphs(source: str) str