Config

Struct Config 

Source
pub struct Config { /* private fields */ }
Expand description

Configuration for LaTeX rendering

This struct controls various aspects of how the Markdown AST is converted to LaTeX. Use the builder methods to customize the output style.

§Examples

use markdown_ppp::latex_printer::config::*;

// Default configuration
let config = Config::default();

// Custom configuration
let config = Config::default()
    .with_width(120)
    .with_table_style(TableStyle::Booktabs)
    .with_code_block_style(CodeBlockStyle::Minted);

Implementations§

Source§

impl Config

Source

pub fn with_width(self, width: usize) -> Self

Set the line width for pretty-printing

Controls how the pretty-printer wraps long lines. This affects the formatting of the generated LaTeX, not the content itself.

§Arguments
  • width - Maximum line width in characters
§Examples
use markdown_ppp::latex_printer::config::Config;

let config = Config::default().with_width(120);
Source

pub fn with_table_style(self, table_style: TableStyle) -> Self

Set the table rendering style

Controls which LaTeX environment is used for tables and what styling rules are applied.

§Arguments
  • table_style - The desired table style
§Examples
use markdown_ppp::latex_printer::config::*;

let config = Config::default()
    .with_table_style(TableStyle::Booktabs);
Source

pub fn with_code_block_style(self, code_block_style: CodeBlockStyle) -> Self

Set the code block rendering style

Controls which LaTeX environment is used for code blocks and whether syntax highlighting is applied.

§Arguments
  • code_block_style - The desired code block style
§Examples
use markdown_ppp::latex_printer::config::*;

let config = Config::default()
    .with_code_block_style(CodeBlockStyle::Minted);

Trait Implementations§

Source§

impl Default for Config

Source§

fn default() -> Self

Create a default configuration

Default settings:

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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