mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Implemented dynamic loading of the Wiki in the online documentation.
This commit is contained in:
parent
f27a54be97
commit
0886177c5a
17
doc/latex2sphinx/_static/insertIframe.js
Normal file
17
doc/latex2sphinx/_static/insertIframe.js
Normal file
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
{% 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]))
|
||||
|
Loading…
Reference in New Issue
Block a user