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