pub fn render_markdown(
        &mut self,
        permalinks: &HashMap<String, String>,
        tera: &Tera,
        config: &Config,
        plugins: &Plugins,
        anchor_insert: InsertAnchor,
    ) -> Result<()> {
        let mut context = RenderContext::new(
            tera,
            config,
            Some(plugins),
            &self.permalink,
            permalinks,
            anchor_insert,
        );

        context.tera_context.insert("page", &SerializingPage::from_page_basic(self, None));

        let res = render_content(&self.raw_content, &context).map_err(|e| {
            Error::chain(format!("Failed to render content of {}", self.file.path.display()), e)
        })?;

        self.summary = res.summary_len.map(|l| res.body[0..l].to_owned());
        self.content = res.body;
        self.toc = res.toc;
        self.external_links = res.external_links;
        self.internal_links_with_anchors = res.internal_links_with_anchors;

        Ok(())
    }
/// We need access to all pages url to render links relative to content
/// so that can't happen at the same time as parsing
We need access to all pages url to render links relative to content
so that can't happen at the same time as parsing
We need access to all pages url to render links relative to content so that can ' t happen at the same time as parsing
pub fn render_markdown(
        &mut self,
        permalinks: &HashMap<String, String>,
        tera: &Tera,
        config: &Config,
        plugins: &Plugins,
        anchor_insert: InsertAnchor,
    ) -> Result<()> {
        let mut context = RenderContext::new(
            tera,
            config,
            Some(plugins),
            &self.permalink,
            permalinks,
            anchor_insert,
        );
        context.tera_context.insert("page", &SerializingPage::from_page_basic(self, None));
        let res = render_content(&self.raw_content, &context).map_err(|e| {
            Error::chain(format!("Failed to render content of {}", self.file.path.display()), e)
        })?;
        self.summary = res.summary_len.map(|l| res.body[0..l].to_owned());
        self.content = res.body;
        self.toc = res.toc;
        self.external_links = res.external_links;
        self.internal_links_with_anchors = res.internal_links_with_anchors;
        Ok(())
    }
pub fn render_markdown ( & mut self , permalinks : & HashMap < String , String > , tera : & Tera , config : & Config , plugins : & Plugins , anchor_insert : InsertAnchor , ) -> Result < ( ) > { let mut context = RenderContext :: new ( tera , config , Some ( plugins ) , & self . permalink , permalinks , anchor_insert , ) ; context . tera_context . insert ( " " , & SerializingPage :: from_page_basic ( self , None ) ) ; let res = render_content ( & self . raw_content , & context ) . map_err ( | e | { Error :: chain ( format ! ( " " self file path display ( ) ) , e ) } ) ? ; self . summary = res . summary_len . map ( | l | res . body [ 0 .. l ] . to_owned ( ) ) ; self . content = res . body ; self . toc = res . toc ; self . external_links = res . external_links ; self . internal_links_with_anchors = res . internal_links_with_anchors ; Ok ( ( ) ) }
We need access to all pages url to render links relative to content
so that can't happen at the same time as parsing
We need access to all pages url to render links relative to content so that can ' t happen at the same time as parsing
&mut self
permalinks
&HashMap<String, String>
tera
&Tera
config
&Config
plugins
&Plugins
anchor_insert
InsertAnchor