Skip to content

Commit

Permalink
Add examples to LaTeX / PDF doxygen manual
Browse files Browse the repository at this point in the history
Add the examples a shown in the HTML / CHM documentation also to the LaTeX / PDF documentation.

- doc/*.doc
  added latexonly part referencing the example in the appendix

- doc/Doxyfile
  silence the generation of the manual

- doc/doxygen_manual.tex
  add the examples as appendices to the manual, by means of the subinputfrom command the parts included by refman_doc are taken from the specified directory

- examples/*.cfg
  adjusted configuration files ("Doxyfile") to generate LaTeX output

- examples/*.h and examples/*.cpp
  make names unique so no conflicts occur when adding all the examples

- examples/CMakeLists.txt
  add generation of the file to be included (see strip_example.py), adjust dependencies and add the refman_doc.tex as output target

- examples/input_test.cpp
  file added (adjusted copy of example_test.cpp) to overcome name clashes (example_test.cpp would have been included twice)

- examples/strip_example.py
  we are only interested in the documentation files as included in the different examples, so we get those commands. The preamble will be handled by the doxygen_manual.tex and we have already an index in the doxygen_manual.tex so we don't need a separate one from each example.

The module / diagram documentation is dependent on the presence of 'dot', this is reflected in the docblocks.doc, CMakeLists.txt and doxygen_manual.tex
  • Loading branch information
albert-github committed Sep 5, 2015
1 parent 5aa4ade commit 5e11f88
Show file tree
Hide file tree
Showing 49 changed files with 416 additions and 145 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
8 changes: 8 additions & 0 deletions doc/autolink.doc
Expand Up @@ -115,6 +115,10 @@
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 @@ -131,6 +135,10 @@ typedef struct StructName TypeName
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
58 changes: 57 additions & 1 deletion doc/commands.doc
Expand Up @@ -363,6 +363,10 @@ Structural indicators
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 @@ -377,6 +381,11 @@ Structural indicators
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 @@ -425,6 +434,10 @@ Structural indicators
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 Down Expand Up @@ -456,6 +469,10 @@ Structural indicators
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 @@ -506,6 +527,10 @@ Structural indicators
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 @@ -540,7 +565,10 @@ Structural indicators
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 @@ -790,6 +822,10 @@ Structural indicators
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 @@ -814,6 +850,10 @@ Structural indicators
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 @@ -970,6 +1010,10 @@ Structural indicators
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 @@ -1121,6 +1165,10 @@ Section indicators
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 @@ -1464,6 +1512,10 @@ ALIASES = "english=\if english" \
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 @@ -2070,6 +2122,10 @@ Commands for displaying examples
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
7 changes: 7 additions & 0 deletions doc/diagrams.doc
Expand Up @@ -142,6 +142,13 @@ 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
66 changes: 66 additions & 0 deletions doc/doxygen_manual.tex
Expand Up @@ -29,6 +29,8 @@
\usepackage{textcomp}
\usepackage[nointegrals]{wasysym}
\usepackage{alltt}
\usepackage{import}
\usepackage[titletoc]{appendix}
\usepackage{ifpdf}
\ifpdf
\usepackage[pdftex,
Expand Down Expand Up @@ -117,5 +119,69 @@ \part{Developers Manual}
\chapter{Doxygen's internals}\label{arch}\hypertarget{arch}{}\input{arch}
\chapter{Perl Module Output format}\label{perlmod}\hypertarget{perlmod}{}\input{perlmod}
\chapter{Internationalization}\label{langhowto}\hypertarget{langhowto}{}\input{langhowto}
\renewcommand{\thepart}{}
\part{Appendices}
\appendix
%mean that subinputfrom requires a / at the end of the path
\chapter{Autolink Example}\label{autolink_example}\hypertarget{autolink_example}{}
\subinputfrom{../html/examples/autolink/latex/}{refman_doc}
\chapter{Resolving Typedef Example}\label{restypedef_example}\hypertarget{restypedef_example}{}
\subinputfrom{../html/examples/restypedef/latex/}{refman_doc}

\IfFileExists{../html/examples/diagrams/latex/refman_doc.tex}
{
\chapter{Diagrams Example}\label{diagrams_example}\hypertarget{diagrams_example}{}
\subinputfrom{../html/examples/diagrams/latex/}{refman_doc}
}{}

\chapter{Modules Example}\label{modules_example}\hypertarget{modules_example}{}
\subinputfrom{../html/examples/group/latex/}{refman_doc}
\chapter{Member Groups Example}\label{memgrp_example}\hypertarget{memgrp_example}{}
\subinputfrom{../html/examples/memgrp/latex/}{refman_doc}
\chapter{After Block Example}\label{afterdoc_example}\hypertarget{afterdoc_example}{}
\subinputfrom{../html/examples/afterdoc/latex/}{refman_doc}
\chapter{QT Style Example}\label{qtstyle_example}\hypertarget{qtstyle_example}{}
\subinputfrom{../html/examples/qtstyle/latex/}{refman_doc}
\chapter{Javadoc Style Example}\label{jdstyle_example}\hypertarget{jdstyle_example}{}
\subinputfrom{../html/examples/jdstyle/latex/}{refman_doc}
\chapter{Structural Commands Example}\label{structcmd_example}\hypertarget{structcmd_example}{}
\subinputfrom{../html/examples/structcmd/latex/}{refman_doc}
\chapter{Python Docstring Example}\label{python_example}\hypertarget{python_example}{}
\subinputfrom{../html/examples/docstring/latex/}{refman_doc}
\chapter{Python Example}\label{py_example}\hypertarget{py_example}{}
\subinputfrom{../html/examples/pyexample/latex/}{refman_doc}
\chapter{VHDL Example}\label{vhdl_example}\hypertarget{vhdl_example}{}
\subinputfrom{../html/examples/mux/latex/}{refman_doc}
\chapter{Tcl Example}\label{tcl_example}\hypertarget{tcl_example}{}
\subinputfrom{../html/examples/tclexample/latex/}{refman_doc}

\chapter{Class Example}\label{class_example}\hypertarget{class_example}{}
\subinputfrom{../html/examples/class/latex/}{refman_doc}
\chapter{Define Example}\label{define_example}\hypertarget{define_example}{}
\subinputfrom{../html/examples/define/latex/}{refman_doc}
\chapter{Enum Example}\label{enum_example}\hypertarget{enum_example}{}
\subinputfrom{../html/examples/enum/latex/}{refman_doc}
\chapter{Example Example}\label{example_example}\hypertarget{example_example}{}
\subinputfrom{../html/examples/example/latex/}{refman_doc}
\chapter{Extends/Implements Example}\label{extends_example}\hypertarget{extends_example}{}
\subinputfrom{../html/examples/manual/latex/}{refman_doc}
\chapter{File Example}\label{file_example}\hypertarget{file_example}{}
\subinputfrom{../html/examples/file/latex/}{refman_doc}
\chapter{Fn Example}\label{fn_example}\hypertarget{fn_example}{}
\subinputfrom{../html/examples/func/latex/}{refman_doc}
\chapter{Overload Example}\label{overload_example}\hypertarget{overload_example}{}
\subinputfrom{../html/examples/overload/latex/}{refman_doc}
\chapter{Page Example}\label{page_example}\hypertarget{page_example}{}
\subinputfrom{../html/examples/page/latex/}{refman_doc}
\chapter{Relates Example}\label{relates_example}\hypertarget{relates_example}{}
\subinputfrom{../html/examples/relates/latex/}{refman_doc}
\chapter{Author Example}\label{author_example}\hypertarget{author_example}{}
\subinputfrom{../html/examples/author/latex/}{refman_doc}
\chapter{Par Example}\label{par_example}\hypertarget{par_example}{}
\subinputfrom{../html/examples/par/latex/}{refman_doc}
\chapter{Include Example}\label{include_example}\hypertarget{include_example}{}
\subinputfrom{../html/examples/include/latex/}{refman_doc}


\printindex
\end{document}
8 changes: 8 additions & 0 deletions doc/grouping.doc
Expand Up @@ -141,6 +141,10 @@ in .c files without having to duplicate the hierarchy exactly.
Click <a href="examples/group/html/modules.html">here</a>
for the corresponding HTML documentation that is generated by Doxygen.
\endhtmlonly
\latexonly
See \hyperlink{modules_example}{Modules example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

\section memgroup Member Groups

Expand Down Expand Up @@ -194,6 +198,10 @@ documentation of the class.
Click <a href="examples/memgrp/html/class_test.html">here</a>
for the corresponding HTML documentation that is generated by Doxygen.
\endhtmlonly
\latexonly
See \hyperlink{memgrp_example}{Member Groups example}
for the corresponding \mbox{\LaTeX} documentation that is generated by doxygen.
\endlatexonly

Here Group1 is displayed as a subsection of the "Public Members". And
Group2 is a separate section because it contains members with
Expand Down

0 comments on commit 5e11f88

Please sign in to comment.