Struct TypesettingData

Source
pub struct TypesettingData {
Show 17 fields pub diagnostics: Vec<(StatementAddress, Diagnostic)>, pub latex_defs: HashMap<Token, (Span, GlobalSpan, Token), BuildHasherDefault<FnvHasher>>, pub html_defs: HashMap<Token, (Span, GlobalSpan, Token), BuildHasherDefault<FnvHasher>>, pub alt_html_defs: HashMap<Token, (Span, GlobalSpan, Token), BuildHasherDefault<FnvHasher>>, pub html_var_color: Vec<(GlobalSpan, Token)>, pub html_title: Option<(GlobalSpan, Token)>, pub html_home: Option<(GlobalSpan, Token)>, pub html_dir: Option<(GlobalSpan, Token)>, pub alt_html_dir: Option<(GlobalSpan, Token)>, pub html_bibliography: Option<(GlobalSpan, Token)>, pub html_css: Option<(GlobalSpan, Token)>, pub html_font: Option<(GlobalSpan, Token)>, pub ext_html_label: Option<(GlobalSpan, Token)>, pub ext_html_title: Option<(GlobalSpan, Token)>, pub ext_html_home: Option<(GlobalSpan, Token)>, pub ext_html_bibliography: Option<(GlobalSpan, Token)>, pub html_ext_url: Option<(GlobalSpan, Token)>,
}
Expand description

The parsed $t comment data.

Fields§

§diagnostics: Vec<(StatementAddress, Diagnostic)>

Any errors detected while parsing this segment.

§latex_defs: HashMap<Token, (Span, GlobalSpan, Token), BuildHasherDefault<FnvHasher>>

LaTeX definitions are used to replace a token with a piece of latex syntax. Each entry has the form (token, replacement).

latexdef "ph" as "\varphi";
§html_defs: HashMap<Token, (Span, GlobalSpan, Token), BuildHasherDefault<FnvHasher>>

HTML definitions are used to replace a token with a piece of HTML syntax. This version will generally be used for the GIF rendering version of the web pages. Each entry has the form (token, replacement).

htmldef "ph" as "<IMG SRC='_varphi.gif' WIDTH=11 HEIGHT=19 ALT=' ph' TITLE='ph'>";
§alt_html_defs: HashMap<Token, (Span, GlobalSpan, Token), BuildHasherDefault<FnvHasher>>

HTML definitions are used to replace a token with a piece of HTML syntax. This version will generally be used for the unicode rendering version of the web pages. Each entry has the form (token, replacement).

althtmldef "ph" as "<SPAN CLASS=wff STYLE='color:blue'>&#x1D711;</SPAN>";
§html_var_color: Vec<(GlobalSpan, Token)>

A piece of HTML to give the variable color key. All htmlvarcolor directives are given separately here, but they are logically concatenated with spaces for rendering.

htmlvarcolor '<SPAN CLASS=wff STYLE="color:blue;font-style:normal">wff</SPAN> '
  + '<SPAN CLASS=setvar STYLE="color:red;font-style:normal">setvar</SPAN> '
  + '<SPAN CLASS=class STYLE="color:#C3C;font-style:normal">class</SPAN>';
§html_title: Option<(GlobalSpan, Token)>

The title of the generated HTML page.

htmltitle "Metamath Proof Explorer";
§html_home: Option<(GlobalSpan, Token)>

The link to the home page in the generated HTML page.

htmlhome '<A HREF="mmset.html"><FONT SIZE=-2 FACE=sans-serif>' +
    '<IMG SRC="mm.gif" BORDER=0 ALT='  +
    '"Home" HEIGHT=32 WIDTH=32 ALIGN=MIDDLE STYLE="margin-bottom:0px">' +
    'Home</FONT></A>';
§html_dir: Option<(GlobalSpan, Token)>

The relative path from the unicode version to the GIF version. Used for cross references. (This is a set.mm specific hack.)

htmldir "../mpegif/";
§alt_html_dir: Option<(GlobalSpan, Token)>

The relative path from the GIF version to the unicode version. Used for cross references. (This is a set.mm specific hack.)

althtmldir "../mpeuni/";
§html_bibliography: Option<(GlobalSpan, Token)>

Optional file where bibliographic references are kept.

htmlbibliography "mmset.html";
§html_css: Option<(GlobalSpan, Token)>

Custom CSS to be placed in the header of generated files. Note that any \n escapes are not yet replaced by newlines in this html_css variable; library consumers are responsible for performing this replacement.

htmlcss '<STYLE TYPE="text/css">\n' +
  '</STYLE>\n' +
  '<LINK href="mmset.css" title="mmset"\n' +
  '    rel="stylesheet" type="text/css">\n';
§html_font: Option<(GlobalSpan, Token)>

Tag(s) for the main SPAN surrounding all Unicode math.

htmlfont 'CLASS=math';
§ext_html_label: Option<(GlobalSpan, Token)>

A label, such that everything after this label uses the ext_* variables instead of the regular ones. (This is a set.mm specific hack.)

exthtmllabel "chil";
§ext_html_title: Option<(GlobalSpan, Token)>

The title of the generated HTML page, for the Hilbert Space extension. (This is a set.mm specific hack.)

exthtmltitle "Hilbert Space Explorer";
§ext_html_home: Option<(GlobalSpan, Token)>

The link to the home page in the generated HTML page, for the Hilbert Space extension. (This is a set.mm specific hack.)

exthtmlhome '<A HREF="mmhil.html"><FONT SIZE=-2 FACE=sans-serif>' +
   '<IMG SRC="atomic.gif" BORDER=0 ALT='  +
   '"Home" HEIGHT=32 WIDTH=32 ALIGN=MIDDLE STYLE="margin-bottom:0px">' +
   'Home</FONT></A>';
§ext_html_bibliography: Option<(GlobalSpan, Token)>

Optional file where bibliographic references are kept, for the Hilbert Space extension. (This is a set.mm specific hack.)

exthtmlbibliography "mmhil.html";
§html_ext_url: Option<(GlobalSpan, Token)>

Optional link(s) to other versions of the theorem page. A “” is replaced with the label of the current theorem. If you need a literal “” as part of the URL, use the alternate URL encoding “%2A”. (Note that * characters are not interpreted in this string; library consumers are responsible for implementing this spec.)

htmlexturl '<A HREF="http://metamath.tirix.org/*.html">'
    + 'Structured version</A>&nbsp;&nbsp; '
    + '<A HREF="https://expln.github.io/metamath/asrt/*.html">'
    + 'Visualization version</A>&nbsp;&nbsp; ';

Implementations§

Source§

impl TypesettingData

Source

pub fn get_alt_html_def(&self, symbol: TokenPtr<'_>) -> Option<&Token>

Get the unicode rendering for a given symbol

Trait Implementations§

Source§

impl Clone for TypesettingData

Source§

fn clone(&self) -> TypesettingData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TypesettingData

Source§

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

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

impl Default for TypesettingData

Source§

fn default() -> TypesettingData

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.