pub struct Renderer { /* private fields */ }Expand description
Owns a configured minijinja environment with the page template registered.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn new(page_template: &str) -> Result<Self, Error>
pub fn new(page_template: &str) -> Result<Self, Error>
Build a renderer from a page-template source string.
Sourcepub fn render_page(&self, ctx: &PageContext<'_>) -> Result<String, Error>
pub fn render_page(&self, ctx: &PageContext<'_>) -> Result<String, Error>
Render one page to a full HTML document.
Sourcepub fn render_graph(&self, ctx: &GraphContext<'_>) -> Result<String, Error>
pub fn render_graph(&self, ctx: &GraphContext<'_>) -> Result<String, Error>
Render the /graph/ doc-link-graph page to a full HTML document.
graph_json is injected raw (the island’s JSON.parse needs valid JSON,
not HTML-escaped text). To stop a literal </script> inside a doc title
from breaking out of the embedding <script type="application/json"> tag,
</ is rewritten to <\/ first — still valid JSON, inert as markup.
Sourcepub fn render_history(&self, ctx: &HistoryContext<'_>) -> Result<String, Error>
pub fn render_history(&self, ctx: &HistoryContext<'_>) -> Result<String, Error>
Render one doc’s history timeline to a full HTML document.
Sourcepub fn render_preview(&self, ctx: &PreviewContext<'_>) -> Result<String, Error>
pub fn render_preview(&self, ctx: &PreviewContext<'_>) -> Result<String, Error>
Render the editor’s live-preview document (content-only, real asset stack).
Sourcepub fn render_diff(&self, ctx: &DiffContext<'_>) -> Result<String, Error>
pub fn render_diff(&self, ctx: &DiffContext<'_>) -> Result<String, Error>
Render the /diff/ workspace shell to a full HTML document.
Auto Trait Implementations§
impl !Freeze for Renderer
impl !RefUnwindSafe for Renderer
impl !UnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more