Skip to main content

OpenMath

Struct OpenMath 

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

OpenMath post-processor.

Port of LaTeXML::Post::OpenMath.

Implementations§

Source§

impl OpenMath

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Default for OpenMath

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl MathProcessor for OpenMath

Source§

fn convert_node( &self, doc: &PostDocument, xmath: &Node, ) -> Option<MathConversion>

Convert an XMath node to this processor’s format. Read more
Source§

fn combine_parallel( &self, _doc: &PostDocument, _xmath: &Node, primary: MathConversion, secondaries: Vec<MathConversion>, ) -> MathConversion

Combine parallel markup from primary conversion + secondaries. Read more
Source§

fn outer_wrapper( &self, _doc: &PostDocument, _xmath: &Node, conversion: NodeData, ) -> NodeData

Wrap the converted XML in the appropriate outer element (e.g., m:math). Read more
Source§

fn raw_id_suffix(&self) -> &str

Raw ID suffix for this format (e.g., “.pmml”, “.cmml”, “.om”). Primary format returns empty string; secondaries return their suffix. Read more
Source§

fn is_secondary(&self) -> bool

Whether this processor is a secondary (parallel) processor.
Source§

fn can_convert(&self, _doc: &PostDocument, math: &Node) -> bool

Whether this processor can convert the given math node. Default: always true. Read more
Source§

fn preprocess(&self, _doc: &PostDocument, _nodes: &[Node])

Optional preprocessing before conversion begins. Read more
Source§

fn parallel_secondaries(&self) -> &[Box<dyn MathProcessor>]

Parallel-markup secondaries held by this (primary) processor. During the primary’s process_math_node, each secondary’s convert_node runs against the still-live XMath and the results are folded into one <m:semantics> via combine_parallel. Empty by default (standalone, single-format). Port of Perl MathProcessor’s primary→secondary parallel model.
Source§

fn id_suffix(&self) -> &str

ID suffix: empty for primary, raw_id_suffix for secondary. Read more
Source§

impl Processor for OpenMath

Source§

fn get_name(&self) -> &str

Human-readable name for this processor.
Source§

fn to_process(&self, doc: &PostDocument) -> Vec<Node>

Return the nodes to be processed; by default the document element. This allows processors to focus on specific kinds of nodes, or to skip processing if there are none to process.
Source§

fn process(&mut self, doc: PostDocument, _nodes: Vec<Node>) -> ProcessResult

Process the document given the nodes returned by to_process. Returns the resulting document(s) — splitting may produce multiple.
Source§

fn resource_directory(&self) -> Option<&str>

Resource directory for generated resources (images, etc.).
Source§

fn resource_prefix(&self) -> Option<&str>

Resource prefix for generated resource filenames.
Source§

fn desired_resource_pathname( &self, _doc: &PostDocument, _node: &Node, _source: Option<&str>, _type_ext: Option<&str>, ) -> Option<PathBuf>

Hint for a desired resource pathname.
Source§

fn generate_resource_pathname( &self, doc: &mut PostDocument, _node: &Node, _source: Option<&str>, type_ext: Option<&str>, ) -> PathBuf

Auto-generate a unique resource pathname using a counter from the doc cache.

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.