【问题标题】:Directive for including a raw HTML file in a ReStructured Text page在 ReStructured Text 页面中包含原始 HTML 文件的指令
【发布时间】:2016-12-21 21:22:40
【问题描述】:

我正在渲染一个.rst 页面。我想在其中创建一个IFrame,其中包含来自同一目录的example.html 页面,或者在页面上找到一些类似的替代方法来托管HTML。实现这一目标的最简单方法是什么?


到目前为止,我已经尝试了几种方法。 (1):

.. include:: ./example.html

这会将 HTML 呈现为文本文件。

(2):

.. raw:: html

    <iframe src="./example.html" marginwidth="0" marginheight="0" scrolling="no" style="width:960px; height:600px; border:0; overflow:hidden;">
    </iframe>

这会生成一个嵌入的 404 页面(但是一旦我将所有内容都托管在服务器上,它会正确显示吗?)。

【问题讨论】:

    标签: html iframe restructuredtext


    【解决方案1】:

    我建议使用 include file 指令,然后在要包含的 html 文件中使用:

    .. raw:: html
    
       html content
    

    【讨论】:

    • 这是一个非常有效的聪明技巧。希望未来分享我的困境的作者能在这里找到自己的路!
    猜你喜欢
    • 2015-10-17
    • 2015-10-30
    • 1970-01-01
    • 1970-01-01
    • 2011-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-11
    相关资源
    最近更新 更多