Skip to content

Commit

Permalink
Merge pull request #395 from albert-github/feature/bug_examples_pdf
Browse files Browse the repository at this point in the history
Add examples to LaTeX / PDF doxygen manual
  • Loading branch information
Dimitri van Heesch committed Sep 13, 2015
2 parents d14bcd1 + 3a236fd commit 9a4a4db
Show file tree
Hide file tree
Showing 49 changed files with 447 additions and 168 deletions.
2 changes: 1 addition & 1 deletion doc/Doxyfile
Expand Up @@ -16,7 +16,7 @@ PROJECT_NAME = "Doxygen"
OUTPUT_DIRECTORY = ..
HTML_HEADER =
HTML_FOOTER =
QUIET = NO
QUIET = YES
WARNINGS = YES
DISABLE_INDEX = YES
GENERATE_TREEVIEW = YES
Expand Down
12 changes: 10 additions & 2 deletions doc/autolink.doc
Expand Up @@ -110,11 +110,15 @@
patterns 3 and 7 in this case.

\par Example:
\verbinclude autolink.cpp
\include autolink.cpp
\htmlonly
Click <a href="examples/autolink/html/index.html">here</a>
for the corresponding HTML documentation that is generated by Doxygen.
\endhtmlonly
\latexonly
See \hyperlink{autolink_example}{Autolink example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\section resolving typedefs

Expand All @@ -126,11 +130,15 @@ typedef struct StructName TypeName
when either StructName itself or TypeName is encountered.

\par Example:
\verbinclude restypedef.cpp
\include restypedef.cpp
\htmlonly
Click <a href="examples/restypedef/html/restypedef_8cpp.html">here</a>
for the corresponding HTML documentation that is generated by Doxygen.
\endhtmlonly
\latexonly
See \hyperlink{restypedef_8cpp}{Typedef example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\htmlonly
Go to the <a href="output.html">next</a> section or return to the
Expand Down
86 changes: 71 additions & 15 deletions doc/commands.doc
Expand Up @@ -358,11 +358,15 @@ Structural indicators
the \ref cmdheaderfile "\\headerfile" command.

\par Example:
\verbinclude class.h
\include class.h
\htmlonly
Click <a href="examples/class/html/index.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{class_example}{Class example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

<hr>
\section cmddef \\def <name>
Expand All @@ -372,11 +376,16 @@ Structural indicators
\c \#define macro.

\par Example:
\verbinclude define.h
\include define.h
\htmlonly
Click <a href="examples/define/html/define_8h.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{define_8h}{Define example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly


<hr>
\section cmddefgroup \\defgroup <name> (group title)
Expand Down Expand Up @@ -420,11 +429,15 @@ Structural indicators
of an anonymous enum can.

\par Example:
\verbinclude enum.h
\include enum.h
\htmlonly
Click <a href="examples/enum/html/class_test.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{class_enum___test}{Enum example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

<hr>
\section cmdexample \\example <file-name>
Expand All @@ -449,13 +462,17 @@ Structural indicators
the \ref cmdinclude "\\include" command can be used.

\par Example:
\verbinclude example.cpp
\include example.cpp
Where the example file \c example_test.cpp looks as follows:
\verbinclude example_test.cpp
\include example_test.cpp
\htmlonly
Click <a href="examples/example/html/examples.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{example_test_8cpp-example}{Example example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\sa section \ref cmdinclude "\\include".

Expand All @@ -482,6 +499,10 @@ Structural indicators
Click <a href="examples/manual/html/index.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{extends_example}{Extends example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\sa section \ref cmdimplements "\\implements" and section
\ref cmdmemberof "\\memberof"
Expand All @@ -501,11 +522,15 @@ Structural indicators
only be included in the output if the file they are in is documented as well.

\par Example:
\verbinclude file.h
\include file.h
\htmlonly
Click <a href="examples/file/html/file_8h.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{file_example}{File example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\note In the above example \ref cfg_javadoc_autobrief "JAVADOC_AUTOBRIEF"
has been set to \c YES in the configuration file.
Expand Down Expand Up @@ -535,12 +560,15 @@ Structural indicators
information and thus to errors.

\par Example:
\verbinclude func.h
\include func.h
\htmlonly
Click <a href="examples/func/html/class_test.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly

\latexonly
See \hyperlink{class_fn___test}{Fn example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\sa sections \ref cmdvar "\\var", \ref cmdproperty "\\property", and
\ref cmdtypedef "\\typedef".
Expand Down Expand Up @@ -622,6 +650,10 @@ Structural indicators
Click <a href="examples/manual/html/index.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{extends_example}{Implements example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\sa section \ref cmdextends "\\extends" and section
\ref cmdmemberof "\\memberof"
Expand Down Expand Up @@ -785,11 +817,15 @@ Structural indicators
\par Note 2:
The \c \\overload command does not work inside a one-line comment.
\par Example:
\verbinclude examples/overload.cpp
\include overload.cpp
\htmlonly
Click <a href="examples/overload/html/class_test.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{class_overload___test}{Overload example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

<hr>
\section cmdpackage \\package <name>
Expand All @@ -809,11 +845,15 @@ Structural indicators
starts a new section in the chapter 'Page documentation'.

\par Example:
\verbinclude page.doc
\include page.doc
\htmlonly
Click <a href="examples/page/html/pages.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{page_example}{Page example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\par Note:
The \<name\> argument consists of a combination of letters and number
Expand Down Expand Up @@ -965,11 +1005,15 @@ Structural indicators
only works for functions.

\par Example:
\verbinclude relates.cpp
\include relates.cpp
\htmlonly
Click <a href="examples/relates/html/class_string.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{class_string}{Relates example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

<hr>
\section cmdrelated \\related <name>
Expand Down Expand Up @@ -1116,11 +1160,15 @@ Section indicators
sectioning command is encountered.

\par Example:
\verbinclude author.cpp
\include author.cpp
\htmlonly
Click <a href="examples/author/html/class_some_nice_class.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{class_some_nice_class}{Author example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

<hr>
\section cmdauthors \\authors { list of authors }
Expand Down Expand Up @@ -1459,11 +1507,15 @@ ALIASES = "english=\if english" \
sectioning command is encountered.

\par Example:
\verbinclude par.cpp
\include par.cpp
\htmlonly
Click <a href="examples/par/html/class_test.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{class_par___test}{Par example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

<hr>
\section cmdparam \\param [(dir)] <parameter-name> { parameter description }
Expand Down Expand Up @@ -2063,13 +2115,17 @@ Commands for displaying examples
\c \\dontinclude command sets the pointer to the first line of the example.

\par Example:
\verbinclude include.cpp
\include include.cpp
Where the example file \c example_test.cpp looks as follows:
\verbinclude example_test.cpp
\include example_test.cpp
\htmlonly
Click <a href="examples/include/html/example.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{include_example}{Include example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

Alternatively, the \ref cmdsnippet "\\snippet" command can be used to
include only a fragment of a source file. For this to work the
Expand Down
17 changes: 12 additions & 5 deletions doc/diagrams.doc
Expand Up @@ -127,21 +127,28 @@ Here are a couple of header files that together show the various diagrams
that doxygen can generate:

<code>diagrams_a.h</code>
\verbinclude diagrams_a.h
\include diagrams_a.h
<code>diagrams_b.h</code>
\verbinclude diagrams_b.h
\include diagrams_b.h
<code>diagrams_c.h</code>
\verbinclude diagrams_c.h
\include diagrams_c.h
<code>diagrams_d.h</code>
\verbinclude diagrams_d.h
\include diagrams_d.h
<code>diagrams_e.h</code>
\verbinclude diagrams_e.h
\include diagrams_e.h

\htmlonly
Click <a href="examples/diagrams/html/index.html">here</a>
for the corresponding HTML documentation that is generated by doxygen<br/>
(<code>EXTRACT_ALL</code> = <code>YES</code> is used here).
\endhtmlonly
\latexonly
\IfFileExists{../html/examples/diagrams/latex/refman_doc.tex}
{
See \hyperlink{diagrams_example}{Diagrams example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
} {}
\endlatexonly

\htmlonly
<br><br>
Expand Down
32 changes: 32 additions & 0 deletions doc/docblocks.doc
Expand Up @@ -262,6 +262,10 @@ Here is an example of the use of these comment blocks:
Click <a href="examples/afterdoc/html/class_test.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{afterdoc_example}{After Block example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\warning These blocks can only be used to document \e members and \e parameters.
They cannot be used to document files, classes, unions, structs,
Expand All @@ -278,6 +282,10 @@ Here is an example of a documented piece of C++ code using the Qt style:
Click <a href="examples/qtstyle/html/class_test.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{qtstyle_example}{QT Style example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

The brief descriptions are included in the member overview of a
class, namespace or file and are printed using a small italic font
Expand Down Expand Up @@ -308,6 +316,10 @@ JavaDoc style and \ref cfg_javadoc_autobrief "JAVADOC_AUTOBRIEF" set to YES:
Click <a href="examples/jdstyle/html/class_test.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{jdstyle_example}{Javadoc Style example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

Similarly, if one wishes the first sentence of a Qt style documentation
block to automatically be treated as a brief description, one may set
Expand Down Expand Up @@ -384,6 +396,10 @@ using structural commands:
Click <a href="examples/structcmd/html/structcmd_8h.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{structcmd_example}{Structural Commands example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

Because each comment block in the example above contains a structural command, all
the comment blocks could be moved to another location or input file
Expand Down Expand Up @@ -424,6 +440,10 @@ and assume they have to be represented in a preformatted way.
Click <a href="examples/docstring/html/index.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{python_example}{Python Docstring example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

Note that in this case none of doxygen's \ref cmd_intro "special commands"
are supported.
Expand All @@ -440,6 +460,10 @@ Here is the same example again but now using doxygen style comments:
Click <a href="examples/pyexample/html/index.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{py_example}{Python example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

Since python looks more like Java than like C or C++, you should set
\ref cfg_optimize_output_java "OPTIMIZE_OUTPUT_JAVA" to \c YES in the
Expand All @@ -465,6 +489,10 @@ Here is an example VHDL file with doxygen comments:
Click <a href="examples/mux/html/index.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{vhdl_example}{VHDL example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

To get proper looking output you need to set
\ref cfg_optimize_output_vhdl "OPTIMIZE_OUTPUT_VHDL" to \c YES in the
Expand Down Expand Up @@ -574,6 +602,10 @@ Following is an example using doxygen style comments:
Click <a href="examples/tclexample/html/index.html">here</a>
for the corresponding HTML documentation that is generated by doxygen.
\endhtmlonly
\latexonly
See \hyperlink{tcl_example}{TCL example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly


\section docstructure Anatomy of a comment block
Expand Down

0 comments on commit 9a4a4db

Please sign in to comment.