tutorial_cross_referencing.markdown 2.1 KB
Newer Older
1 2 3
Cross referencing OpenCV from other Doxygen projects {#tutorial_cross_referencing}
====================================================

4 5 6
@prev_tutorial{tutorial_transition_guide}


7 8 9
Cross referencing OpenCV
------------------------

S
Steve Nicholson 已提交
10
[Doxygen](http://www.doxygen.nl) is a tool to generate
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
documentations like the OpenCV documentation you are reading right now.
It is used by a variety of software projects and if you happen to use it
to generate your own documentation, and you are using OpenCV inside your
project, this short tutorial is for you.

Imagine this warning inside your documentation code:

@code
/**
 * @warning This functions returns a cv::Mat.
 */
@endcode

Inside your generated documentation this warning will look roughly like this:

@warning This functions returns a %cv::Mat.

While inside the OpenCV documentation the `%cv::Mat` is rendered as a link:

@warning This functions returns a cv::Mat.

To generate links to the OpenCV documentation inside your project, you only
have to perform two small steps. First download the file
[opencv.tag](opencv.tag) (right-click and choose "save as...") and place it
somewhere in your project directory, for example as
`docs/doxygen-tags/opencv.tag`.

Open your Doxyfile using your favorite text editor and search for the key
`TAGFILES`. Change it as follows:

@code
A
Alexander Alekhin 已提交
42
TAGFILES = ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.4.16
43 44 45 46 47 48
@endcode

If you had other definitions already, you can append the line using a `\`:

@code
TAGFILES = ./docs/doxygen-tags/libstdc++.tag=https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen \
A
Alexander Alekhin 已提交
49
           ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.4.16
50 51 52 53 54 55 56 57 58 59 60 61 62
@endcode

Doxygen can now use the information from the tag file to link to the OpenCV
documentation. Rebuild your documentation right now!

@note To allow others to also use a *.tag file to link to your documentation,
set `GENERATE_TAGFILE = html/your_project.tag`. Your documentation will now
contain a `your_project.tag` file in its root directory.


References
----------

S
Steve Nicholson 已提交
63
- [Doxygen: Linking to external documentation](http://www.doxygen.nl/manual/external.html)
64
- [opencv.tag](opencv.tag)