pub struct Spx2HtmlEngine { /* private fields */ }
Expand description

An engine that converts SPX to HTML.

Implementations§

source§

impl Spx2HtmlEngine

source

pub fn assets_spec_path<S>(&mut self, path: S) -> &mut Spx2HtmlEngine
where S: ToString,

Emit an asset specification file and not actual assets.

“Assets” are files like fonts and images that accompany the HTML output generated during processing. SPX files contain commands that implicitly and explicitly create assets. By default, these are emitted during processing. If this method is called, the assets will not be created, as if you called Self::do_not_emit_assets. Instead, an “asset specification” file will be emitted to the given output path. This specification file contains the information needed to generate the assets upon a later invocation. Asset specification files can be merged, allowing the results of multiple separate TeX compilations to be synthesized into one HTML output tree.

Currently, the asset specification is written in JSON format, although it is not guaranteed that this will always be the case. It will always be a UTF8-encoded, line-oriented textual format, though.

source

pub fn precomputed_assets( &mut self, assets: AssetSpecification ) -> &mut Spx2HtmlEngine

Specify that this session should use a precomputed asset specification.

If this function is used, subsequent runs will generate HTML outputs assuming the information given in the asset specification. If the input calls for new assets or different options inconsistent with the specification, processing will abort with an error.

The purpose of this mode is to allow for a unified set of assets to be created from multiple independent runs of the SPX-to-HTML stage. First, the different inputs should be processed independently, and their individual assets should saved. These should then be merged. Then the inputs should be reprocessed, all using the merged asset specification. In one — but only one — of these sessions, the assets should actually be emitted.

source

pub fn do_not_emit_files(&mut self) -> &mut Spx2HtmlEngine

Specify that templated output files should not actually be created.

You probably want this engine to actually write its outputs to the filesystem. If you call this function, it will not. This mode can be useful if the main purpose of the processing run is to gather information about the assets that will be generated.

source

pub fn do_not_emit_assets(&mut self) -> &mut Spx2HtmlEngine

Specify that supporting “asset” files should not actually be created.

You probably want this engine to actually write these assets to the filesystem. If you call this function, it will not. This mode can be useful if the main purpose of the processing run is to gather information about the assets that will be generated.

Calling Self::assets_spec_path has the same effect as this function, but also causes an asset specification file to be written to in Tectonic’s virtual I/O backend.

source

pub fn output_base( &mut self, out_base: impl Into<PathBuf> ) -> &mut Spx2HtmlEngine

Specify the root path for output files.

Because this driver will, in the generic case, produce a tree of HTML output files that are not going to be used as a basis for any subsequent engine stages, it outputs directly to disk rather than using the I/O layer. I don’t like hardcoding use of the filesystem, but I don’t want to build up some extra abstraction layer right now.

source

pub fn process_to_filesystem( &mut self, hooks: &mut dyn DriverHooks, status: &mut dyn StatusBackend, spx: &str ) -> Result<(), Error>

Process SPX into HTML.

Before calling this function, you must explicitly specify the output mode by calling either Self::do_not_emit_files or Self::output_base. If you do not, this function will panic.

Trait Implementations§

source§

impl Debug for Spx2HtmlEngine

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Spx2HtmlEngine

source§

fn default() -> Spx2HtmlEngine

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

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more