Expand description
Post-processing pipeline API.
Provides a public interface to the LaTeXML post-processing pipeline
(Scan → Bibliography → CrossRef → Graphics → Split → MathML → XSLT → HTML5 fixups).
Used by both the latexml_oxide binary and the cortex_worker binary.
Structs§
- Core
Release After BibGuard - RAII guard returned by
arm_core_release_after_bibthat clears the flag on drop even if post-processing returns early beforeMakeBibliography. - Post
Options - Options for the post-processing pipeline.
- Post
Outcome - Result of
run_post_processing_logged: the serialized HTML plus the post-phase log text and status code, mirroring PerlLaTeXML.pm’sconvert_post, which flushes the log AFTER post and folds the post status into the finalmax(core, post)verdict (L631-634). - Staged
Handoff - A core handoff staged on disk for the streaming file parser, removed when dropped and on the exits that skip destructors.
Functions§
- arm_
core_ release_ after_ bib - Arm one-shot teardown of dead core TeX engine state (
STATE,STOMACH,GULLET,StringInterner, and per-conversion caches) on the current thread right afterMakeBibliographycompletes inrun_post_processing_*. - default_
stylesheet - The built-in XSLT stylesheet for an output format (Perl
Config.pmL543-551), as theembed:///name served from the binary, never a copy on disk (#806). ReturnsNonefor a format with no default (e.g.xml), so a caller keeps--stylesheet/ no post. - parse_
xslt_ parameter - Split one
--xsltparameterinto(name, value): Perl’sname:value(LaTeXML.pm L575/^\s*(\w+)\s*:\s*(.*)$/, bin/latexmlpost L354) first, else ourname=value;Nonewhen it is neither (#803). - reserve_
core_ handoff - The handoff file a split run’s core result is serialized into (
Config::handoff_file), reserved before the conversion: when the run would take the streaming split, which parses only files, the document-sizedStringwould exist only to be staged (2 GiB on Nasser’s whole book, issue 777).Nonewhen it would not. - run_
post_ processing - Run the post-processing pipeline on in-memory XML output.
- run_
post_ processing_ from_ file - File-input variant of
run_post_processing. - run_
post_ processing_ from_ file_ logged - File-input variant of
run_post_processing_logged: parses the XML from disk via libxml2’s streaming reader rather than from an in-memoryString. Used for already-converted.xmlinputs, where slurping the file would keep a whole extra copy of a multi-hundred-MB document resident alongside the DOM. - run_
post_ processing_ logged - Run post-processing while capturing its log into a fresh thread-local
LOG_BUFFER.
Converter::convert()already flushed the core log into its own response, leaving the buffer unbound — so without re-binding here every post-phaseInfo!/Warn!/post_error(incl. a silent EPS→PNG failure) reaches stderr only and never the persisted--log/cortex.log. Perl’s singleflush_log()afterconvert_postsweeps up the post log for ALL consumers; this is the Rust equivalent, shared by thelatexml_oxideandcortex_workerbinaries so their logs reach parity. See SYNC_STATUS task 5. - run_
post_ processing_ owned_ logged run_post_processing_loggedtaking the core result by value: a handoff staged to disk (seehandoff_needs_file) is dropped before post runs, so the core XML is not resident beside the post pipeline — on Nasser’s 2,400-problem book a few hundred MB of the single-invocation peak.- run_
post_ processing_ staged_ logged run_post_processing_owned_loggedfor a core result the conversion serialized intostaged(reserve_core_handoff), so noStringof it ever existed. A file the gate keeps in memory (a test’sLATEXML_POST_STREAM_THRESHOLDabove its size) is read back and post-processed as thatStringwould be.- used_
core_ handoff - The reserved handoff, kept only when the core serialized into it (
ConversionResponse::handoff_file). An unused one is dropped here, removing a file an earlier attempt wrote: a fused eager attempt’s salvage, when the--streamingrerun on the same path ends without a document.