pub enum CodeBlockStyle {
Verbatim,
Listings,
Minted,
}Expand description
Code block rendering style
Controls how Markdown fenced and indented code blocks are converted to LaTeX environments. Each style offers different features for syntax highlighting and formatting.
Variants§
Verbatim
Basic verbatim environment
Uses the standard LaTeX verbatim environment. No syntax highlighting
but maximum compatibility. Language information is ignored.
Requirements: None (built into LaTeX)
Example output:
\begin{verbatim}
fn main() {
println!("Hello");
}
\end{verbatim}Listings
Syntax highlighting with listings package
Uses the listings package for syntax highlighting. Supports many
programming languages and offers extensive customization options.
Language is taken from the fenced code block info string.
Requirements: listings package
Example output:
\begin{lstlisting}[language=rust]
fn main() {
println!("Hello");
}
\end{lstlisting}Minted
Advanced syntax highlighting with minted package
Uses the minted package which leverages Pygments for superior
syntax highlighting. Requires Python and Pygments to be installed.
Supports more languages and produces better highlighting than listings.
Requirements: minted package, Python, Pygments
Example output:
\begin{minted}{rust}
fn main() {
println!("Hello");
}
\end{minted}Trait Implementations§
Source§impl Clone for CodeBlockStyle
impl Clone for CodeBlockStyle
Source§fn clone(&self) -> CodeBlockStyle
fn clone(&self) -> CodeBlockStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more