Skip to main content

Module content

Module content 

Source
Expand description

Epub content build functionality

This module provides functionality for creating EPUB content documents.

§Usage

use lib_epub::{
    builder::content::{Block, BlockBuilder, ContentBuilder},
    types::{BlockType, Footnote},
};

let mut block_builder = BlockBuilder::new(BlockType::Title);
block_builder
    .set_content("This is a title")
    .add_footnote(Footnote {
        locate: 15,
        content: "This is a footnote.".to_string(),
    });
let block = block_builder.build()?;

let mut builder = ContentBuilder::new("chapter1", "zh-CN")?;
builder.set_title("My Chapter")
    .add_block(block)?
    .add_text_block("This is my first chapter.", vec![])?;
let _ = builder.make("output.xhtml")?;

§Future Work

  • Support more types of content Block

§Notes

  • Requires content_builder functionality to use this module.

Structs§

BlockBuilder
Block Builder
ContentBuilder
Content Builder

Enums§

Block
Content Block