Skip to main content

EpubManifest

Struct EpubManifest 

Source
pub struct EpubManifest { /* private fields */ }
Expand description

EPUB manifest builder.

Port of LaTeXML::Post::Manifest::Epub.

Implementations§

Source§

impl EpubManifest

Source

pub fn new(site_directory: &str) -> Self

Source

pub fn initialize( &mut self, _title: &str, _authors: &[String], _language: &str, ) -> Result<(), String>

Initialize the EPUB directory structure.

Port of Epub::initialize.

Source

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.

Source

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.)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.