diff --git a/doc/latex2sphinx/_static/insertIframe.js b/doc/latex2sphinx/_static/insertIframe.js new file mode 100644 index 0000000000..68df739a5e --- /dev/null +++ b/doc/latex2sphinx/_static/insertIframe.js @@ -0,0 +1,17 @@ +function insertIframe (elementId, iframeSrc) +{ + var iframe; + if (document.createElement && (iframe = document.createElement('iframe'))) + { + iframe.src = iframeSrc; + iframe.width = "100%"; + iframe.height = "511px"; + var element = document.getElementById(elementId); + element.parentNode.replaceChild(iframe, element); + } +} + + + + + diff --git a/doc/latex2sphinx/_themes/blue/layout.html b/doc/latex2sphinx/_themes/blue/layout.html index f688b3ab7c..4aa67a8a1a 100644 --- a/doc/latex2sphinx/_themes/blue/layout.html +++ b/doc/latex2sphinx/_themes/blue/layout.html @@ -1,5 +1,7 @@ {% extends "basic/layout.html" %} +{% set script_files = script_files + [pathto("_static/insertIframe.js", 1)] %} + {% block document %}
{%- if not embedded %}{% if not theme_nosidebar|tobool %} diff --git a/doc/latex2sphinx/buildall b/doc/latex2sphinx/buildall index d93e930232..422fba593d 100644 --- a/doc/latex2sphinx/buildall +++ b/doc/latex2sphinx/buildall @@ -12,4 +12,13 @@ do mkdir -p $D cp conf.py $D TEXINPUTS=$PWD: sphinx-build -w $D/sphinx.errors -D "lang=$D" -b html -d _build/doctrees/$D $D _build/html/$D + + #Insert javascript links to load the Wiki in a frame + for file in `ls _build/html/$D/*.html` + do + cat $file | sed "/Comments from the Wiki/s/href=\"\(.*\)\">id=0.\([0-9]*\) /href=\"javascript:void\(0\)\" onclick=\"insertIframe\('\2', '\1'\)\" id=\"\2\">/" > tmp.html + mv 'tmp.html' "$file" + done done + + diff --git a/doc/latex2sphinx/latex.py b/doc/latex2sphinx/latex.py index 902a05e1e9..fde1dfe442 100644 --- a/doc/latex2sphinx/latex.py +++ b/doc/latex2sphinx/latex.py @@ -7,6 +7,7 @@ import pyparsing as pp import StringIO from qfile import QOpen from string import Template +from random import random # useful things for pyparsing def returnList(x): @@ -152,7 +153,7 @@ class SphinxWriter: self.cur_module = self.render(c.params[1].str) def wikiLink(self, name): - return '*Comments on* `wiki `__' % (self.language, self.cur_module, name) + return '`id=%s Comments from the Wiki `__' % (random(), self.language, self.cur_module, name) def cmd_cvCppCross(self, c): self.write(":func:`%s`" % str(c.params[0]))