8
votes

I'm trying to embed doxygen documentation into another website. At the moment I have it embedded with an iframe, but it has the side effect that if I open any of the links in the documentation on a new tab, for example, it will go to the separate linked doxygen page outside of the frame.

The main site also happens to be generated with sphinx, but the breathe extension is not yet ready to automatically organize such complex documentation without manually writing many .rst files.

Also, doxylink reference links such as this link to a file found on the reference page.

It seems the shark machine learning library was able to pull this feat off to some degree with the classlist, but it is difficult to determine the exact technique they used. Plus, their license is GPL which is incompatible with my library's BSD license.

How can I make sure the documentation is always embedded?

Here is how a correctly embedded page should appear:

basis_embedded_doxygen

But some links lead to a page like this:

basis_not_embedded_doxygen

1

1 Answers

-2
votes

You are essentially opening a link inside an iframe, and want to open that link in the same iframe. This can be done by:

<iframe src="http://cnn.com/" name="myFrame"></iframe>
<p>
    <a href="http://cnn.com/" target="myFrame"></a>
</p>

which will load all links in the same iframe.

Here is my JSFiddle: http://jsfiddle.net/yb82en46/

Sources:

How to open a iframe link within the same iframe? - StackOverflow

You should specify target name of the iframe.

<iframe src="demo_iframe.htm" name="iframe_a"></iframe>
<p><a href="http://www.w3schools.com" target="iframe_a">www.google.com</a></p>