Commit 0886177c authored by Ilya Lysenkov's avatar Ilya Lysenkov

Implemented dynamic loading of the Wiki in the online documentation.

parent f27a54be
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);
}
}
{% extends "basic/layout.html" %}
{% set script_files = script_files + [pathto("_static/insertIframe.js", 1)] %}
{% block document %}
<div class="documentwrapper">
{%- if not embedded %}{% if not theme_nosidebar|tobool %}
......
......@@ -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
......@@ -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 <http://opencv.willowgarage.com/wiki/documentation/%s/%s/%s>`__' % (self.language, self.cur_module, name)
return '`id=%s Comments from the Wiki <http://opencv.willowgarage.com/wiki/documentation/%s/%s/%s>`__' % (random(), self.language, self.cur_module, name)
def cmd_cvCppCross(self, c):
self.write(":func:`%s`" % str(c.params[0]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment