Search code examples
pythonrestructuredtextpelican

Adding HTML in Blog Articles Written in RST Format in Pelican


I am trying to get my hands on Pelican.

I need a feature, so that I can put some direct HTML files into the blog articles written in rst format. I also want those HTML files to be rendered.

The use case is like this: I want to show some html code and also how it looks like on the browser.

PS: I know how to attach code blocks, but this requirement is inverse of that, I want the HTML files to be actually rendered, rather than protected.


Solution

  • You can give the HTML subheading to the raw directive and the content will be rendered.

    .. raw:: html
    
        <p> I need a feature, so that I can put some direct HTML in the blog articles written in <b>rst</b> format. I also want those htmls to be rendered.</p>
    

    See here: How to embed HTML in restructured text file?

    please note: there must be a newline between the ..raw:: directive and the actual raw html.