GSoC 2016 - Adding ALIASES for tutorial (#7041)
* GSoC 2016 - Adding toggle files to be used by tutorials. Add a toggle option for tutorials. * adds a button on the HTML tutorial pages to switch between blocks * the default option is for languages: one can write a block for C++ and another one for Python without re-writing the tutorial Add aliases to the doxyfile. * adding alises to make a link to previous and next tutorial. * adding alias to specify the toggle options in the tutorials index. * adding alias to add a youtube video directly from link. Add a sample tutorial (mat_mask_opertaions) using the developed aliases: * youtube alias * previous and next tutorial alias * buttons * languages info for tutorial table of content * code referances with snippets (and associated sample code files) * Removing the automatic ordering. Adding specific toggles for cpp, java and python. Move all the code to the footer / header and Doxyfile. Updating documentation.
This commit is contained in:
committed by
Maksim Shabunin
parent
36b5abf6b7
commit
fcddfa4f86
@@ -439,6 +439,83 @@ Then include this snippet into documentation:
|
||||
compatibility with the old rST documentation. But newly created samples should be included with the
|
||||
_snippet_ command, since this method is less affected by the changes in processed file.
|
||||
|
||||
### Toggle buttons inclusion commands {#tutorial_documentation_toggle_buttons_commands_include}
|
||||
|
||||
Toggle buttons are used to display the selected configuration (e.g. programming language, OS, IDE).
|
||||
|
||||
To use the buttons in documentation, _add_toggle_ and _end_toggle_ commands are used.
|
||||
|
||||
The command _add_toggle_ can be
|
||||
- general: _add_toggle{Button Name}_
|
||||
- for C++: _add_toggle_cpp_
|
||||
- for Java: _add_toggle_java_
|
||||
- for Python: _add_toggle_python_
|
||||
|
||||
Example:
|
||||
@verbatim
|
||||
@add_toggle{Button Name}
|
||||
|
||||
text / code / doxygen commands
|
||||
|
||||
@end_toggle
|
||||
@endverbatim
|
||||
|
||||
For example using toggle buttons with text and [code](@ref tutorial_documentation_commands_include) snippets:
|
||||
|
||||
@verbatim
|
||||
|
||||
### Buttons Example
|
||||
|
||||
@add_toggle_cpp
|
||||
|
||||
Text for C++ button
|
||||
@snippet samples/cpp/tutorial_code/introduction/documentation/documentation.cpp hello_world
|
||||
|
||||
@end_toggle
|
||||
|
||||
@add_toggle_java
|
||||
|
||||
Text for Java button
|
||||
@snippet samples/java/tutorial_code/introduction/documentation/Documentation.java hello_world
|
||||
|
||||
@end_toggle
|
||||
|
||||
@add_toggle_python
|
||||
|
||||
Text for Python button
|
||||
@snippet samples/python/tutorial_code/introduction/documentation/documentation.py hello_world
|
||||
|
||||
@end_toggle
|
||||
|
||||
@endverbatim
|
||||
|
||||
Result looks like this:
|
||||
|
||||
### Buttons Example
|
||||
|
||||
@add_toggle_cpp
|
||||
|
||||
Text for C++ button
|
||||
@snippet samples/cpp/tutorial_code/introduction/documentation/documentation.cpp hello_world
|
||||
|
||||
@end_toggle
|
||||
|
||||
@add_toggle_java
|
||||
|
||||
Text for Java button
|
||||
@snippet samples/java/tutorial_code/introduction/documentation/Documentation.java hello_world
|
||||
|
||||
@end_toggle
|
||||
|
||||
@add_toggle_python
|
||||
|
||||
Text for Python button
|
||||
@snippet samples/python/tutorial_code/introduction/documentation/documentation.py hello_world
|
||||
|
||||
@end_toggle
|
||||
|
||||
As you can see, the buttons are added automatically under the previous heading.
|
||||
|
||||
### Grouping commands {#tutorial_documentation_commands_group}
|
||||
|
||||
All code entities should be put into named groups representing OpenCV modules and their internal
|
||||
@@ -536,6 +613,8 @@ Write the tutorial {#tutorial_documentation_steps_tutorial}
|
||||
|
||||
If you want to insert code blocks from this file into your tutorial, mark them with special doxygen comments (see [here](@ref tutorial_documentation_commands_include)).
|
||||
|
||||
If you want to write the tutorial in more than one programming language, use the toggle buttons for alternative comments and code (see [here](@ref tutorial_documentation_toggle_buttons_commands_include)).
|
||||
|
||||
3. Collect results of the application work. It can be "before/after" images or some numbers
|
||||
representing performance or even a video.
|
||||
|
||||
@@ -552,22 +631,21 @@ Write the tutorial {#tutorial_documentation_steps_tutorial}
|
||||
|
||||
5. Modify your new page:
|
||||
- Add page title and identifier, usually prefixed with <em>"tutorial_"</em> (see [here](@ref tutorial_documentation_md_page)).
|
||||
You can add a link to the previous and next tutorial using the identifier
|
||||
@verbatim
|
||||
@prev_tutorial{identifier}
|
||||
@next_tutorial{identifier}
|
||||
@endverbatim
|
||||
@warning Do **not** write the **hashtag (#)**, example: \n Incorrect: @verbatim @prev_tutorial{#tutorial_documentation} @endverbatim Correct: @verbatim @prev_tutorial{tutorial_documentation} @endverbatim
|
||||
- Add brief description of your idea and tutorial goals.
|
||||
- Describe your program and/or its interesting pieces.
|
||||
- Describe your results, insert previously added images or other results.
|
||||
|
||||
To add a video use _htmlonly_, _endhtmlonly_ commands with raw html block inside:
|
||||
To add a youtube video, e.g. www.youtube.com/watch?v= **ViPN810E0SU**, use _youtube_{**Video ID**}:
|
||||
@verbatim
|
||||
@htmlonly
|
||||
<div align="center">
|
||||
<iframe
|
||||
title="my title" width="560" height="349"
|
||||
src="http://www.youtube.com/embed/ViPN810E0SU?rel=0&loop=1"
|
||||
frameborder="0" allowfullscreen align="middle">
|
||||
</iframe>
|
||||
</div>
|
||||
@endhtmlonly
|
||||
@youtube{ViPN810E0SU}
|
||||
@endverbatim
|
||||
|
||||
- Add bibliographic references if any (see [here](@ref tutorial_documentation_commands_cite)).
|
||||
|
||||
6. Add newly created tutorial to the corresponding table of contents. Just find
|
||||
@@ -576,6 +654,8 @@ Write the tutorial {#tutorial_documentation_steps_tutorial}
|
||||
@verbatim
|
||||
- @subpage tutorial_windows_visual_studio_image_watch
|
||||
|
||||
_Languages:_ C++, Java, Python
|
||||
|
||||
_Compatibility:_ \>= OpenCV 2.4
|
||||
|
||||
_Author:_ Wolf Kienzle
|
||||
|
||||
Reference in New Issue
Block a user