pub struct EpubManifest { /* private fields */ }Expand description
EPUB manifest builder.
Port of LaTeXML::Post::Manifest::Epub.
Implementations§
Source§impl EpubManifest
impl EpubManifest
pub fn new(site_directory: &str) -> Self
Sourcepub fn initialize(
&mut self,
_title: &str,
_authors: &[String],
_language: &str,
) -> Result<(), String>
pub fn initialize( &mut self, _title: &str, _authors: &[String], _language: &str, ) -> Result<(), String>
Initialize the EPUB directory structure.
Port of Epub::initialize.
Sourcepub fn add_document(
&self,
destination: &str,
has_math: bool,
has_svg: bool,
has_nav: bool,
) -> SpineEntry
pub fn add_document( &self, destination: &str, has_math: bool, has_svg: bool, has_nav: bool, ) -> SpineEntry
Add a document to the EPUB spine.
Port of Epub::process per-document loop.
Sourcepub fn generate_opf(
&self,
title: &str,
authors: &[String],
language: &str,
spine: &[SpineEntry],
resources: &[ResourceEntry],
) -> String
pub fn generate_opf( &self, title: &str, authors: &[String], language: &str, spine: &[SpineEntry], resources: &[ResourceEntry], ) -> String
Generate the content.opf package document.
Port of Epub::finalize. Built through the libxml DOM rather than by
push_str, because an OPF is parsed by strict readers: one unescaped &
in a single href invalidates the whole package, not one entry.
That was reachable. href is format!("{}.{}", name, ext) over a split
document’s file stem, and --splitnaming=label takes that stem from the
author’s \label{...} — \label{Fisher&Yates} really does produce a file
named Fisher&Yates.xhtml. The old builder escaped 2 of 12 interpolated
values and href was not one of them. libxml escapes on set, so the
question no longer arises for any of them. (Issue 386 item 2.)