Skip to content

Commit 56fe2dc

Browse files
committed
Merge pull request opencv#9773 from shoeffner:feature/doxygen-tag-file
2 parents 5f6ce6f + 440e8d4 commit 56fe2dc

File tree

3 files changed

+70
-1
lines changed

3 files changed

+70
-1
lines changed

doc/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ PREDEFINED = __cplusplus=1 \
255255
EXPAND_AS_DEFINED =
256256
SKIP_FUNCTION_MACROS = YES
257257
TAGFILES =
258-
GENERATE_TAGFILE =
258+
GENERATE_TAGFILE = @CMAKE_DOXYGEN_OUTPUT_PATH@/html/opencv.tag
259259
ALLEXTERNALS = NO
260260
EXTERNAL_GROUPS = YES
261261
EXTERNAL_PAGES = YES
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Cross referencing OpenCV from other Doxygen projects {#tutorial_cross_referencing}
2+
====================================================
3+
4+
Cross referencing OpenCV
5+
------------------------
6+
7+
[Doxygen](https://www.stack.nl/~dimitri/doxygen/) is a tool to generate
8+
documentations like the OpenCV documentation you are reading right now.
9+
It is used by a variety of software projects and if you happen to use it
10+
to generate your own documentation, and you are using OpenCV inside your
11+
project, this short tutorial is for you.
12+
13+
Imagine this warning inside your documentation code:
14+
15+
@code
16+
/**
17+
* @warning This functions returns a cv::Mat.
18+
*/
19+
@endcode
20+
21+
Inside your generated documentation this warning will look roughly like this:
22+
23+
@warning This functions returns a %cv::Mat.
24+
25+
While inside the OpenCV documentation the `%cv::Mat` is rendered as a link:
26+
27+
@warning This functions returns a cv::Mat.
28+
29+
To generate links to the OpenCV documentation inside your project, you only
30+
have to perform two small steps. First download the file
31+
[opencv.tag](opencv.tag) (right-click and choose "save as...") and place it
32+
somewhere in your project directory, for example as
33+
`docs/doxygen-tags/opencv.tag`.
34+
35+
Open your Doxyfile using your favorite text editor and search for the key
36+
`TAGFILES`. Change it as follows:
37+
38+
@code
39+
TAGFILES = ./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.3.0
40+
@endcode
41+
42+
If you had other definitions already, you can append the line using a `\`:
43+
44+
@code
45+
TAGFILES = ./docs/doxygen-tags/libstdc++.tag=https://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen \
46+
./docs/doxygen-tags/opencv.tag=http://docs.opencv.org/3.3.0
47+
@endcode
48+
49+
Doxygen can now use the information from the tag file to link to the OpenCV
50+
documentation. Rebuild your documentation right now!
51+
52+
@note To allow others to also use a *.tag file to link to your documentation,
53+
set `GENERATE_TAGFILE = html/your_project.tag`. Your documentation will now
54+
contain a `your_project.tag` file in its root directory.
55+
56+
57+
References
58+
----------
59+
60+
- [Doxygen: Linking to external documentation](https://www.stack.nl/~dimitri/doxygen/manual/external.html)
61+
- [opencv.tag](opencv.tag)

doc/tutorials/introduction/table_of_content_introduction.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,11 @@ Additionally you can find very basic sample source code to introduce you to the
171171
_Author:_ Maksim Shabunin
172172

173173
This document describes some aspects of 2.4 -> 3.0 transition process.
174+
175+
- @subpage tutorial_cross_referencing
176+
177+
_Compatibility:_ \> OpenCV 3.3.0
178+
179+
_Author:_ Sebastian Höffner
180+
181+
This document outlines how to create cross references to the OpenCV documentation from other Doxygen projects.

0 commit comments

Comments
 (0)