pub struct RenderContext {
pub version: String,
pub root: PathBuf,
pub book: Book,
pub config: Config,
pub destination: PathBuf,
// some fields omitted
}
The context provided to all renderers.
Which version of mdbook
did this come from (as written in mdbook
's
Cargo.toml
). Useful if you know the renderer is only compatible with
certain versions of mdbook
.
The book's root directory.
A loaded representation of the book itself.
The loaded configuration file.
Where the renderer must put any build artefacts generated. To allow
renderers to cache intermediate results, this directory is not
guaranteed to be empty or even exist.
Create a new RenderContext
.
Get the source directory's (absolute) path on disk.
Load a RenderContext
from its JSON representation.
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Serialize this value into the given Serde serializer. Read more
Deserialize this value from the given Serde deserializer. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static