Skip to main content

Typst

Struct Typst 

Source
pub struct Typst;
Expand description

Typst renderer.

Trait Implementations§

Source§

impl Clone for Typst

Source§

fn clone(&self) -> Typst

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Typst

Source§

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

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

impl Default for Typst

Source§

fn default() -> Typst

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

impl OutputFormat for Typst

Source§

type Output = String

The type used for intermediate rendered content. Read more
Source§

fn text(&self, s: &str) -> Self::Output

Convert a raw string into the format’s output type. Read more
Source§

fn join(&self, items: Vec<Self::Output>, delimiter: &str) -> Self::Output

Join multiple outputs into a single output using a delimiter.
Source§

fn finish(&self, output: Self::Output) -> String

Convert the intermediate output into the final result string. Read more
Source§

fn emph(&self, content: Self::Output) -> Self::Output

Render content with emphasis (typically italics).
Source§

fn strong(&self, content: Self::Output) -> Self::Output

Render content with strong emphasis (typically bold).
Source§

fn small_caps(&self, content: Self::Output) -> Self::Output

Render content in small capitals.
Source§

fn superscript(&self, content: Self::Output) -> Self::Output

Render content as superscript text.
Source§

fn quote(&self, content: Self::Output) -> Self::Output

Render content enclosed in outer quotation marks.
Source§

fn affix( &self, prefix: &str, content: Self::Output, suffix: &str, ) -> Self::Output

Apply outer prefix and suffix strings to the content. Read more
Source§

fn inner_affix( &self, prefix: &str, content: Self::Output, suffix: &str, ) -> Self::Output

Apply inner prefix and suffix strings to the content. Read more
Source§

fn wrap_punctuation( &self, wrap: &WrapPunctuation, content: Self::Output, ) -> Self::Output

Wrap the content in specific punctuation (parentheses, brackets, or quotes).
Source§

fn semantic(&self, _class: &str, content: Self::Output) -> Self::Output

Apply a semantic identifier (class) to the content. Read more
Source§

fn annotation(&self, content: Self::Output) -> Self::Output

Render an annotation block. Read more
Source§

fn citation(&self, ids: Vec<String>, content: Self::Output) -> Self::Output

Render a full citation container with one or more reference IDs.
Hyperlink the content to a URL.
Source§

fn format_id(&self, id: &str) -> String

Format a reference ID for use as a target or link (e.g. adding a prefix).
Source§

fn paragraph(&self, content: Self::Output) -> Self::Output

Render a paragraph block.
Source§

fn block_quote(&self, content: Self::Output) -> Self::Output

Render a block quotation.
Source§

fn bullet_list(&self, items: Vec<Self::Output>) -> Self::Output

Render an unordered (bullet) list from pre-rendered item strings.
Source§

fn ordered_list(&self, items: Vec<Self::Output>) -> Self::Output

Render an ordered (numbered) list from pre-rendered item strings.
Source§

fn heading(&self, level: u8, content: Self::Output) -> Self::Output

Render a heading at the given level (1 = top-level).
Source§

fn code_block(&self, lang: Option<&str>, content: Self::Output) -> Self::Output

Render a fenced or indented code block with an optional language hint. Read more
Source§

fn inline_code(&self, content: Self::Output) -> Self::Output

Render inline code.
Source§

fn strikeout(&self, content: Self::Output) -> Self::Output

Render strikethrough text.
Source§

fn hard_break(&self) -> Self::Output

Render a hard line break.
Source§

fn bibliography(&self, entries: Vec<Self::Output>) -> Self::Output

Render a full bibliography container. Read more
Source§

fn entry( &self, id: &str, content: Self::Output, url: Option<&str>, _metadata: &ProcEntryMetadata, ) -> Self::Output

Render a single bibliography entry with its unique identifier and optional link. Read more
Source§

fn quote_marks(&self, depth: usize) -> (&'static str, &'static str)

Return the opening and closing quote delimiters for a nesting depth. Read more
Source§

fn quote_with_depth(&self, content: Self::Output, depth: usize) -> Self::Output

Render content enclosed in quotation marks at a specific nesting depth.
Source§

fn list_item(&self, content: Self::Output) -> Self::Output

Render a list item.
Source§

fn semantic_with_attributes( &self, class: &str, content: Self::Output, _attributes: &[SemanticAttribute], ) -> Self::Output

Apply a semantic identifier plus optional attributes to the content. Read more

Auto Trait Implementations§

§

impl Freeze for Typst

§

impl RefUnwindSafe for Typst

§

impl Send for Typst

§

impl Sync for Typst

§

impl Unpin for Typst

§

impl UnsafeUnpin for Typst

§

impl UnwindSafe for Typst

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> ErasedDestructor for T
where T: 'static,

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