Struct ferru::document::Document
[−]
[src]
pub struct Document { /* fields omitted */ }
A struct representation of a Ferru document, consisting of a YAML header
and a String
body.
Methods
impl Document
[src]
fn new(header: Header, content: &str) -> Document
[src]
Creates a new document from the provided Header
and content &str
.
fn as_html(&self) -> Result<String>
[src]
Renders the document content to a String
, using the header data as
the templating attributes.
fn render_to_file(
&self,
file_path: &Path,
templates: &TemplateMap
) -> Result<()>
[src]
&self,
file_path: &Path,
templates: &TemplateMap
) -> Result<()>
Renders the document to the desired file path, selecting the template specified in the "template" header field as the header from the list of provided templates.
Trait Implementations
impl PartialEq for Document
[src]
fn eq(&self, __arg_0: &Document) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Document) -> bool
[src]
This method tests for !=
.