Struct mdbook_angular::Config

source ·
pub struct Config {
    pub background: bool,
    pub experimental_builder: bool,
    pub playgrounds: bool,
    pub tsconfig: Option<PathBuf>,
    pub inline_style_language: String,
    pub optimize: bool,
    /* private fields */
}
Expand description

Configuration for mdbook-angular

Fields§

§background: bool

Whether to enable the experimental background builder

Enabling this option runs the angular build in a background process, triggering a watch instead of an entire new build whenever mdbook notices a change. This is considerably faster.

This option requires the [Config.experimental_builder] option to be enabled. It only works on builds with the “background” feature enabled, and it only works on platforms rustc considers “unix”. This option is no-op for commands that don’t watch the book source for changes.

Default value: false

§experimental_builder: bool

Whether to use an experimental builder (requires angular ≥ 16.2.0)

If enabled, all chapters in the book will be built in a single go. If disabled, every chapter is built separately as angular application.

Default value: false

§playgrounds: bool

Whether playgrounds are enabled by default

This can be overridden via playground or no-playground tag on every individual code block or {{#angular}} tag.

Default value: true

§tsconfig: Option<PathBuf>

Path to a tsconfig to use for building, relative to the book.toml file

§inline_style_language: String

The inline style language the angular compiler should use

Default value: "css"

§optimize: bool

Whether to optimize the angular applications

This option is ignored if background is active

Default value: false

Implementations§

source§

impl Config

source

pub fn read<P: AsRef<Path>>(root: P) -> Result<Self>

Read mdbook-angular Config from the book.toml file inside the given folder.

Errors

This function will return an error if reading the book.toml fails.

source

pub fn new(ctx: &RenderContext) -> Self

Create mdbook-angular configuration Config from the given render context.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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 Twhere 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 Twhere 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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> Send for Twhere T: ?Sized,

§

impl<T> Sync for Twhere T: ?Sized,