htmliframerestructuredtext

Directive for including a raw HTML file in a ReStructured Text page


I have a .rst page that I am rendering. I would like to create an IFrame in it containing an example.html page from the same directory, or find some similar alternative way of hosting the HTML on the page. What is the easiest way of achieving this?


I've tried a couple of approaches so far. (1):

.. include:: ./example.html

This renders the HTML as if it were a text file.

(2):

.. raw:: html

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

This results in an embedded 404 page (but will it display properly once I get everything server-hosted?).


Solution

  • I suggest using the include file directive, then in the html file you are including, use:

    .. raw:: html
    
       html content