Struct mdbook::theme::Theme

source ·
pub struct Theme {
Show 18 fields pub index: Vec<u8>, pub head: Vec<u8>, pub redirect: Vec<u8>, pub header: Vec<u8>, pub chrome_css: Vec<u8>, pub general_css: Vec<u8>, pub print_css: Vec<u8>, pub variables_css: Vec<u8>, pub fonts_css: Option<Vec<u8>>, pub font_files: Vec<PathBuf>, pub favicon_png: Option<Vec<u8>>, pub favicon_svg: Option<Vec<u8>>, pub js: Vec<u8>, pub highlight_css: Vec<u8>, pub tomorrow_night_css: Vec<u8>, pub ayu_highlight_css: Vec<u8>, pub highlight_js: Vec<u8>, pub clipboard_js: Vec<u8>,
}
Expand description

The Theme struct should be used instead of the static variables because the new() method will look if the user has a theme directory in their source folder and use the users theme instead of the default.

You should only ever use the static variables directly if you want to override the user’s theme with the defaults.

Fields§

§index: Vec<u8>§head: Vec<u8>§redirect: Vec<u8>§header: Vec<u8>§chrome_css: Vec<u8>§general_css: Vec<u8>§print_css: Vec<u8>§variables_css: Vec<u8>§fonts_css: Option<Vec<u8>>§font_files: Vec<PathBuf>§favicon_png: Option<Vec<u8>>§favicon_svg: Option<Vec<u8>>§js: Vec<u8>§highlight_css: Vec<u8>§tomorrow_night_css: Vec<u8>§ayu_highlight_css: Vec<u8>§highlight_js: Vec<u8>§clipboard_js: Vec<u8>

Implementations§

source§

impl Theme

source

pub fn new<P: AsRef<Path>>(theme_dir: P) -> Self

Creates a Theme from the given theme_dir. If a file is found in the theme dir, it will override the default version.

Trait Implementations§

source§

impl Debug for Theme

source§

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

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

impl Default for Theme

source§

fn default() -> Theme

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

impl PartialEq for Theme

source§

fn eq(&self, other: &Theme) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Theme

Auto Trait Implementations§

§

impl RefUnwindSafe for Theme

§

impl Send for Theme

§

impl Sync for Theme

§

impl Unpin for Theme

§

impl UnwindSafe for Theme

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

§

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

§

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.