pub struct Typst;Expand description
Typst renderer.
Trait Implementations§
Source§impl OutputFormat for Typst
impl OutputFormat for Typst
Source§fn text(&self, s: &str) -> Self::Output
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
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
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
fn emph(&self, content: Self::Output) -> Self::Output
Render content with emphasis (typically italics).
Source§fn strong(&self, content: Self::Output) -> Self::Output
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
fn small_caps(&self, content: Self::Output) -> Self::Output
Render content in small capitals.
Source§fn superscript(&self, content: Self::Output) -> Self::Output
fn superscript(&self, content: Self::Output) -> Self::Output
Render content as superscript text.
Source§fn quote(&self, content: Self::Output) -> Self::Output
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
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
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
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
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
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
fn citation(&self, ids: Vec<String>, content: Self::Output) -> Self::Output
Render a full citation container with one or more reference IDs.
Source§fn link(&self, url: &str, content: Self::Output) -> Self::Output
fn link(&self, url: &str, content: Self::Output) -> Self::Output
Hyperlink the content to a URL.
Source§fn format_id(&self, id: &str) -> String
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 block_quote(&self, content: Self::Output) -> Self::Output
fn block_quote(&self, content: Self::Output) -> Self::Output
Render a block quotation.
Source§fn bullet_list(&self, items: Vec<Self::Output>) -> Self::Output
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
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
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
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
fn inline_code(&self, content: Self::Output) -> Self::Output
Render inline code.
Source§fn hard_break(&self) -> Self::Output
fn hard_break(&self) -> Self::Output
Render a hard line break.
Source§fn bibliography(&self, entries: Vec<Self::Output>) -> Self::Output
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
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)
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
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 semantic_with_attributes(
&self,
class: &str,
content: Self::Output,
_attributes: &[SemanticAttribute],
) -> Self::Output
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more