mbook
Read, edit and create mbook files.
An mbook file holds a book as Markdown chapters and AVIF pictures in one
indexed container. mbook is the Rust library for it:
BookReaderreads a book lazily from anything that can seek. Opening it reads the tables; each chapter and picture is decoded when asked for.Bookis a whole book in memory. It is how a book is created and how an existing one is changed.
use Book;
let mut book = new?;
book.meta_mut.add_author?;
book.add_chapter?;
book.save?;
Status
Implements version 1.0 of the format as drafted: lazy reading, loading into memory, creating, editing, checking and writing. The format is still a draft and may change. Rendering Markdown and decoding AVIF are left to the application: chapters are returned as text and pictures as AVIF bytes.
Cargo features
| Feature | Default | Enables |
|---|---|---|
read |
yes | BookReader, Book::read, Book::open |
write |
yes | Book::new and every call that changes, checks or saves a Book |
At least one of them must be enabled. Requires Rust 1.89 or later.
Documentation
License
Licensed under either of the Apache License, Version 2.0, or the MIT license, at your option.