【问题标题】:Adding HTML in Blog Articles Written in RST Format in Pelican在 Pelican 中以 RST 格式编写的博客文章中添加 HTML
【发布时间】:2015-03-05 07:10:31
【问题描述】:

我正在尝试接触鹈鹕。

我需要一个特性,这样我就可以将一些直接的 HTML 文件放到博客中 以 rst 格式编写的文章。我还希望渲染这些 HTML 文件。

用例是这样的:我想展示一些 html 代码以及它在浏览器上的样子。

PS:我知道如何附加代码块,但这个要求与此相反,我希望 HTML 文件被实际呈现,而不是受到保护。

【问题讨论】:

    标签: python restructuredtext pelican


    【解决方案1】:

    您可以将 HTML 子标题赋予 raw 指令,然后将呈现内容。

    .. 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>
    

    请看这里: How to embed HTML in restructured text file?

    请注意:..raw:: 指令和实际的原始 html 之间必须有一个换行符。

    【讨论】:

      猜你喜欢
      • 2020-12-06
      • 1970-01-01
      • 2016-05-18
      • 2020-08-25
      • 1970-01-01
      • 2014-03-18
      • 2012-04-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多