Commit f9753a5a authored by Ilya Lysenkov's avatar Ilya Lysenkov

Inserted links to wiki in documentation.

parent 8ff0d754
...@@ -51,6 +51,7 @@ class SphinxWriter: ...@@ -51,6 +51,7 @@ class SphinxWriter:
self.function_props = {} self.function_props = {}
self.covered = set() # covered functions, used for error report self.covered = set() # covered functions, used for error report
self.description = "" self.description = ""
self.cur_module = ""
def write(self, s): def write(self, s):
self.freshline = len(s) > 0 and (s[-1] == '\n') self.freshline = len(s) > 0 and (s[-1] == '\n')
...@@ -144,6 +145,15 @@ class SphinxWriter: ...@@ -144,6 +145,15 @@ class SphinxWriter:
filename = os.path.join('..', '..', str(c.params[0])) filename = os.path.join('..', '..', str(c.params[0]))
print >>self, "\n\n.. image:: %s\n\n" % filename print >>self, "\n\n.. image:: %s\n\n" % filename
def cmd_renewcommand(self, c):
self.indent = 0
command = self.render(c.params[0].str)
if command == 'curModule':
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)
def cmd_cvCppCross(self, c): def cmd_cvCppCross(self, c):
self.write(":func:`%s`" % str(c.params[0])) self.write(":func:`%s`" % str(c.params[0]))
...@@ -165,6 +175,8 @@ class SphinxWriter: ...@@ -165,6 +175,8 @@ class SphinxWriter:
print >>self, nm print >>self, nm
print >>self, '-' * len(nm) print >>self, '-' * len(nm)
print >>self print >>self
print >>self, self.wikiLink(nm)
print >>self
if self.language == 'py': if self.language == 'py':
print >>self, ".. class:: " + nm + "\n" print >>self, ".. class:: " + nm + "\n"
else: else:
...@@ -201,6 +213,8 @@ class SphinxWriter: ...@@ -201,6 +213,8 @@ class SphinxWriter:
print >>self, nm print >>self, nm
print >>self, '-' * len(nm) print >>self, '-' * len(nm)
print >>self print >>self
print >>self, self.wikiLink(nm)
print >>self
self.state = 'fpreamble' self.state = 'fpreamble'
if self.description != "": if self.description != "":
self.report_error(c, "overflow - preceding cvfunc (starting %s) not terminated?" % repr(self.description[:30])) self.report_error(c, "overflow - preceding cvfunc (starting %s) not terminated?" % repr(self.description[:30]))
...@@ -220,6 +234,8 @@ class SphinxWriter: ...@@ -220,6 +234,8 @@ class SphinxWriter:
print >>self, 'cv::%s' % nm print >>self, 'cv::%s' % nm
print >>self, '-' * (4+len(nm)) print >>self, '-' * (4+len(nm))
print >>self print >>self
print >>self, self.wikiLink(nm)
print >>self
self.state = 'fpreamble' self.state = 'fpreamble'
if self.description != "": if self.description != "":
self.report_error(c, "overflow - preceding cvfunc (starting %s) not terminated?" % repr(self.description[:30])) self.report_error(c, "overflow - preceding cvfunc (starting %s) not terminated?" % repr(self.description[:30]))
......
...@@ -19,34 +19,37 @@ showtabs=false, % show tabs within strings adding particular und ...@@ -19,34 +19,37 @@ showtabs=false, % show tabs within strings adding particular und
%escapeinside={\%*}{*)} % if you want to add a comment within your code %escapeinside={\%*}{*)} % if you want to add a comment within your code
} }
\newcommand{\wikiHref}[1]{\hspace{0.1in}\href{http://opencv.willowgarage.com/wiki/documentation/\targetlang/\curModule/#1}{wiki}}
\newcommand{\curModule}{}
\newcommand{\cvclass}[1]{ \newcommand{\cvclass}[1]{
\ifthenelse{\equal{\targetlang}{cpp}} \ifthenelse{\equal{\targetlang}{cpp}}
{ {
\subsection{cv::#1} \subsection[cv::#1]{cv::#1\wikiHref{#1}}
%\addcontentsline{toc}{subsection}{#1} %\addcontentsline{toc}{subsection}{#1}
\index{cv...!#1} \index{cv...!#1}
} }
{ {
\subsection{#1} \subsection[#1]{#1\wikiHref{#1}}
%\addcontentsline{toc}{subsection}{#1} %\addcontentsline{toc}{subsection}{#1}
\index{cv...!#1} \index{cv...!#1}
} }
} }
\newcommand{\cvfunc}[1]{ \newcommand{\cvfunc}[1]{
\subsection{#1} \subsection[#1]{#1\wikiHref{#1}}
%\addcontentsline{toc}{subsection}{#1} %\addcontentsline{toc}{subsection}{#1}
\index{cv...!#1} \index{cv...!#1}
} }
\newcommand{\cvstruct}[1]{ \newcommand{\cvstruct}[1]{
\subsection{#1} \subsection[#1]{#1\wikiHref{#1}}
%\addcontentsline{toc}{subsection}{#1} %\addcontentsline{toc}{subsection}{#1}
\index{cv...!#1} \index{cv...!#1}
} }
\newcommand{\cvmacro}[1]{ \newcommand{\cvmacro}[1]{
\subsection{#1} \subsection[#1]{#1\wikiHref{#1}}
%\addcontentsline{toc}{subsection}{#1} %\addcontentsline{toc}{subsection}{#1}
\index{cv...!#1} \index{cv...!#1}
} }
...@@ -55,12 +58,13 @@ showtabs=false, % show tabs within strings adding particular und ...@@ -55,12 +58,13 @@ showtabs=false, % show tabs within strings adding particular und
\item[\texttt{#1}] #2 \item[\texttt{#1}] #2
} }
\newcommand{\cvFunc}[2]{ \newcommand{\cvFunc}[2]{
\ifthenelse{\equal{\targetlang}{c}} \ifthenelse{\equal{\targetlang}{c}}
{\subsection{cv#1}\index{cv#1}\label{cfunc.#1}} {\subsection[cv::#1]{cv#1\wikiHref{#1}}\index{cv#1}\label{cfunc.#1}}
{\ifthenelse{\equal{\targetlang}{cpp}} {\ifthenelse{\equal{\targetlang}{cpp}}
{\subsection{cv::#2}\index{cv::#2}\label{cppfunc.#2}} {\subsection[cv::#2]{cv::#2\wikiHref{#2}}\index{cv::#2}\label{cppfunc.#2}}
{\subsection{cv.#1}\index{cv.#1}\label{pyfunc.#1}}}} {\subsection[cv::#1]{cv.#1\wikiHref{#1}}\index{cv.#1}\label{pyfunc.#1}}}}
\newcommand{\cvCPyFunc}[1]{\cvFunc{#1}{}} \newcommand{\cvCPyFunc}[1]{\cvFunc{#1}{}}
\newcommand{\cvCppFunc}[1]{\cvFunc{}{#1}} \newcommand{\cvCppFunc}[1]{\cvFunc{}{#1}}
......
\input{core_introduction} \input{core_introduction}
\chapter{core. The Core Functionality} \chapter{core. The Core Functionality}
\renewcommand{\curModule}{core}
\input{core_basic_structures} \input{core_basic_structures}
\input{core_array_operations} \input{core_array_operations}
\input{core_dynamic_structures} \input{core_dynamic_structures}
...@@ -11,6 +12,7 @@ ...@@ -11,6 +12,7 @@
\chapter{imgproc. Image Processing} \chapter{imgproc. Image Processing}
\renewcommand{\curModule}{imgproc}
\input{imgproc_histograms} \input{imgproc_histograms}
\input{imgproc_image_filtering} \input{imgproc_image_filtering}
\input{imgproc_image_warping} \input{imgproc_image_warping}
...@@ -22,20 +24,25 @@ ...@@ -22,20 +24,25 @@
\input{imgproc_object_detection} \input{imgproc_object_detection}
\chapter{features2d. Feature Detection and Descriptor Extraction} \chapter{features2d. Feature Detection and Descriptor Extraction}
\renewcommand{\curModule}{features2d}
\input{features2d_feature_detection} \input{features2d_feature_detection}
\input{features2d_object_recognition} \input{features2d_object_recognition}
\input{features2d_object_detection} \input{features2d_object_detection}
\chapter{flann. Clustering and Search in Multi-Dimensional Spaces} \chapter{flann. Clustering and Search in Multi-Dimensional Spaces}
\renewcommand{\curModule}{flann}
\input{flann} \input{flann}
\chapter{objdetect. Object Detection} \chapter{objdetect. Object Detection}
\renewcommand{\curModule}{objdetect}
\input{objdetect} \input{objdetect}
\chapter{video. Video Analysis} \chapter{video. Video Analysis}
\renewcommand{\curModule}{video}
\input{video_motion_tracking} \input{video_motion_tracking}
\chapter{highgui. High-level GUI and Media I/O} \chapter{highgui. High-level GUI and Media I/O}
\renewcommand{\curModule}{highgui}
\input{highgui} \input{highgui}
\ifPy %Qt is for C and Cpp, so do nothing \ifPy %Qt is for C and Cpp, so do nothing
\else \else
...@@ -43,10 +50,12 @@ ...@@ -43,10 +50,12 @@
\fi \fi
\chapter{calib3d. Camera Calibration, Pose Estimation and Stereo} \chapter{calib3d. Camera Calibration, Pose Estimation and Stereo}
\renewcommand{\curModule}{calib3d}
\input{calib3d} \input{calib3d}
\chapter{ml. Machine Learning} \chapter{ml. Machine Learning}
\renewcommand{\curModule}{ml}
\input{ml} \input{ml}
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