pub struct Content<'a> {
pub content: &'a Content<'a>,
pub root: Option<&'a str>,
pub path: &'a str,
pub syntax_highlight: bool,
}
Expand description
Renders content:
- Raw text will be rendered as escaped paragraphs (separated by double newlines).
- HTML will be injected as-is with no processing.
- Markdown documents will be rendered as one might expect EXCEPT that:
- “./” at the beginning of links, image references, etc. will be replaced with
path
. - If
root
is specified, all links will be made absolute (prefixed withroot
).
- “./” at the beginning of links, image references, etc. will be replaced with
Fields§
§content: &'a Content<'a>
The content to render.
root: Option<&'a str>
The website’s “root” (origin). If specified, links and references will be absolute (markdown only).
path: &'a str
The current page, relative to the root (markdown only).
syntax_highlight: bool
Whether or not to syntax highlight code blocks (markdown only).
Trait Implementations§
Source§impl Render for Content<'_>
impl Render for Content<'_>
Source§fn render(&self, tmpl: &mut TemplateBuffer<'_>)
fn render(&self, tmpl: &mut TemplateBuffer<'_>)
Render this into a template buffer.
Source§impl RenderMut for Content<'_>
impl RenderMut for Content<'_>
Source§fn render_mut(&mut self, tmpl: &mut TemplateBuffer<'_>)
fn render_mut(&mut self, tmpl: &mut TemplateBuffer<'_>)
Render this into a template buffer.
Source§impl RenderOnce for Content<'_>
impl RenderOnce for Content<'_>
Source§fn render_once(self, tmpl: &mut TemplateBuffer<'_>)
fn render_once(self, tmpl: &mut TemplateBuffer<'_>)
Render this into a template buffer.
Auto Trait Implementations§
impl<'a> Freeze for Content<'a>
impl<'a> RefUnwindSafe for Content<'a>
impl<'a> Send for Content<'a>
impl<'a> Sync for Content<'a>
impl<'a> Unpin for Content<'a>
impl<'a> UnwindSafe for Content<'a>
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