/// Renders liquid templates into HTML in the context of current document.
///
/// Takes `content` string and returns rendered HTML. This function doesn't
/// take `"extends"` attribute into account. This function can be used for
/// rendering content or excerpt.
Renders liquid templates into HTML in the context of current document.
Takes `content` string and returns rendered HTML. This function doesn't
take `"extends"` attribute into account. This function can be used for
rendering content or excerpt.
Renders liquid templates into HTML in the context of current document . Takes ` content ` string and returns rendered HTML . This function doesn ' t take ` " extends " ` attribute into account . This function can be used for rendering content or excerpt .
fn render_html(&self,
                   content: &str,
                   globals: &liquid::Object,
                   parser: &template::LiquidParser,
                   syntax_theme: &str)
                   -> Result<String> {
        let template = parser.parse(content)?;
        let html = template.render(globals)?;
        let html = match self.front.format {
            cobalt_model::SourceFormat::Raw => html,
            cobalt_model::SourceFormat::Markdown => {
                let mut buf = String::new();
                let options = cmark::OPTION_ENABLE_FOOTNOTES | cmark::OPTION_ENABLE_TABLES;
                let parser = cmark::Parser::new_ext(&html, options);
                cmark::html::push_html(&mut buf, decorate_markdown(parser, syntax_theme));
                buf
            }
        };
        Ok(html.to_owned())
    }
fn render_html ( & self , content : & str , globals : & liquid :: Object , parser : & template :: LiquidParser , syntax_theme : & str ) -> Result < String > { let template = parser . parse ( content ) ? ; let html = template . render ( globals ) ? ; let html = match self . front . format { cobalt_model :: SourceFormat :: Raw => html , cobalt_model :: SourceFormat :: Markdown => { let mut buf = String :: new ( ) ; let options = cmark :: OPTION_ENABLE_FOOTNOTES | cmark :: OPTION_ENABLE_TABLES ; let parser = cmark :: Parser :: new_ext ( & html , options ) ; cmark :: html :: push_html ( & mut buf , decorate_markdown ( parser , syntax_theme ) ) ; buf } } ; Ok ( html . to_owned ( ) ) }
Renders liquid templates into HTML in the context of current document.
Renders liquid templates into HTML in the context of current document .
&self
content
&str
globals
&liquid::Object
parser
&template::LiquidParser
syntax_theme
&str