Skip to content
Snippets Groups Projects
Commit beaf9daf authored by Steven Palmer's avatar Steven Palmer
Browse files

Small formatting fixes to t01b

parent e6a73ab0
No related branches found
No related tags found
No related merge requests found
No preview for this file type
% Define Document Class
% Class Options Include:
% notes, notesonly, handout, trans,
% hidesubsections, shadesubsections,
% inrow, blue, red, grey, brown
%--------------------------------------------------------------------------
\documentclass[xcolor=dvipsnames, shownotes, colorlinks]{beamer}
%--------------------------------------------------------------------------
% Define Package Theme
%--------------------------------------------------------------------------
\usepackage{color}
\usepackage[T1]{fontenc}
%% \usepackage{fix-cm}
\usepackage{hyperref}
\hypersetup{
urlcolor=cyan,
linkcolor=white
}
\usepackage{subfigure}
%% \usepackage{xspace}
\usepackage{}
\usepackage{enumerate}
\usetheme{Antibes}
\setbeamertemplate{sidebar}[right]
\usepackage{listings} % Code formatting
%% \usepackage{framed}
%% \usepackage{booktabs}
\usepackage{tabularx}
\usepackage{marvosym}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{arrows}
\usetikzlibrary{calc,positioning}
\lstset{
language=Python,
basicstyle=\ttfamily\scriptsize,
tabsize=2,
breaklines=true,
prebreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
frame=single,
showstringspaces=true,
showspaces=false,
keywordstyle=\color{blue},
stringstyle=\color{magenta},
commentstyle=\color{ForestGreen},
literate={\#}{{\textcolor{ForestGreen}{\#}}}1 {@}{{\textcolor{blue}{\MVAt}}}1 {\$}{\vdots}1
}
%--------------------------------------------------------------------------
% Commands
%------------------------------------------------------------------------------
\newcommand*\oldmacro{}%
\let\oldmacro\insertshorttitle%
\renewcommand*\insertshorttitle{%
\oldmacro\hfill%
\insertframenumber\,/\,\inserttotalframenumber}
% Figure Source
\usepackage[absolute,overlay]{textpos}
\setbeamercolor{framesource}{fg=gray}
\setbeamerfont{framesource}{size=\tiny}
\newcommand{\source}[1]{\begin{textblock*}{\paperwidth}(-5pt,\textheight)
\begin{beamercolorbox}[ht=0.5cm,right]{framesource}
\usebeamerfont{framesource}\usebeamercolor[fg]{framesource} Source: {#1}
\end{beamercolorbox}
\end{textblock*}}
%------------------------------------------------------------------------------
% Presentation Title Slide
%--------------------------------------------------------------------------
\title{Generating Documentation with Doxygen}
\subtitle{CS 2ME3/SE 2AA4}
\author{Steven Palmer}
\institute{Department of Computing and Software\\
McMaster University\\ }
\date{January 9 - 13}
%--------------------------------------------------------------------------
% Document
% To add notes to the slides use: \note{}
% Add \section{} or \subsection{} for use in table of contents
%--------------------------------------------------------------------------
\begin{document}
% Create Title Slide
\begin{frame}
\maketitle
\end{frame}
\section[Outline]{}
% Create Table of Contents Slide - Outline
\begin{frame}
\frametitle{Outline}
{\hypersetup{linkcolor=black}
\tableofcontents
}
\end{frame}
\section{What is Doxygen?}
\begin{frame}
\frametitle{What is Doxygen?}
\begin{itemize} \item Doxygen is a tool used to generate documentation for code modules/classes.
\item Comments with special syntax are used in source files to mark information that Doxygen should use.
\item When Doxygen is run, it extracts the marked information from the source file(s) and compiles it into selected output formats.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}
\frametitle{Doxygen Information Flow}
\begin{center}
\includegraphics[width=.7\textwidth]{image/doxy.png}
\end{center}
\end{frame}
% -----------------------------------------------------
\begin{frame}
\frametitle{Doxygen Information Flow}
\begin{center}
\includegraphics[width=.7\textwidth]{image/doxy_subset.png}
\end{center}
\begin{itemize}
\item We will focus on the generation of LaTeX and HTML documentation.
\end{itemize}
\end{frame}
\section{Prerequisite Software}
% -----------------------------------------------------
\begin{frame}
\frametitle{Installing TeX Distribution}
\begin{itemize}
\item You will need a \texttt{TeX} distribution.
\begin{itemize} \item TeX Live is recommended.
\item For Ubuntu-based Linux distributions you can install via \texttt{apt-get install texlive-full}.
\item For other operating systems see \url{https://www.tug.org/texlive/} for installation details.
\end{itemize}
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}
\frametitle{Installing Graphviz}
\begin{itemize}
\item Doxygen uses \texttt{dot}, which is part of the graphviz suite of graph visualization tools.
\begin{itemize} \item For Ubuntu-based Linux distributions you can install via \texttt{apt-get install graphviz}.
\item For other operating systems see \url{http://www.graphviz.org/} for installation details.
\item Depending on your operating system, you may need to add the graphviz bin folder to your path so that \texttt{dot}
can be accessed via the command-line.
\end{itemize}
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}
\frametitle{Installing Make}
\begin{itemize}
\item You will need \texttt{make} to build a pdf from the Doxygen LaTeX output.
\begin{itemize} \item \texttt{make} should be available by default on Linux systems.
\item If you are using OS X and \texttt{make} is not available, you will need to install the Command Line Tools package provided by Apple.
\item If you are using Windows, you should install the MinGW environment (\url{http://www.mingw.org/}). Make sure to add the MinGW bin folder to your path so that \texttt{make} is runnable from the command-line.
\end{itemize}
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}
\frametitle{Installing Doxygen}
\begin{itemize}
\item Finally, you will of course need to install \texttt{Doxygen} itself.
\begin{itemize} \item For Ubuntu-based Linux distributions you can install via \texttt{apt-get install doxygen}.
\item For other operating systems see \url{http://www.stack.nl/~dimitri/doxygen/download.html} for installation details.
\end{itemize}
\end{itemize}
\end{frame}
\section{Using Doxygen}
\subsection{Doxygen Style Comments}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{Doxygen Comments in Python}
\begin{itemize}
\item Doxygen comments in Python use the following simple structure:
\begin{lstlisting}
## @command1 args
# @command2 args
# @command3 args
$
# @commandn args
\end{lstlisting}
\item In general, a Doxygen comment block directly precedes either a class definition, a function definition, or a field definition.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{Documenting Classes}
\begin{itemize}
\item Python classes are documented as follows:
\begin{lstlisting}
## @brief A brief description of ClassX
# @details A more detailed description of ClassX
class ClassX:
...
\end{lstlisting}
\item Depending on the complexity of the class, {\MVAt}details may not be necessary.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{Documenting Functions}
\begin{itemize}
\item Python functions are documented as follows:
\begin{lstlisting}
## @brief A brief description of methodX
# @details A more detailed description of methodX
# @param p1 A description of parameter p1
# @param p2 A description of parameter p2
# @return A description of the returned value
def methodX(p1, p2):
...
return x
\end{lstlisting}
\item Depending on the complexity of the function, {\MVAt}details may not be necessary.
\item There should be an {\MVAt}param entry for every parameter of the function (possibly none). The parameter {\bf self} in class functions should be omitted.
\item {\MVAt}return is not necessary for void functions.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{Documenting Fields}
\begin{itemize}
\item Python fields are documented as follows:
\begin{lstlisting}
## A brief description of fieldX
fieldX = ...
\end{lstlisting}
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{Example}
\begin{itemize}
\item See Box3D.py for a small example of Python code with Doxygen style comments.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{Additional Commands}
\begin{itemize}
\item The Doxygen snippets given in this tutorial as well as the Box3D.py example file provide the basics for documenting your code.
\item Sometimes you may want to use additional commands to capture more details in your documentation.
\item Consult \url{http://www.stack.nl/~dimitri/doxygen/manual/commands.html} for the full listing of available documentation commands and descriptions.
\end{itemize}
\end{frame}
\subsection{Building the Documentation}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{Configuration File}
\begin{itemize}
\item Producing documentation for a given set of source files with Doxygen requires a configuration file.
\item A default configuration file can be generated via the command line with:
\begin{lstlisting}
doxygen -g configFileName
\end{lstlisting}
\item configFileName can be whatever you want.
\item The configuration file needs to be edited to define your project.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[fragile]
\frametitle{Configuration File}
\begin{itemize}
\item Of particular importance for a new configuration are the PROJECT\_NAME (line 35) and INPUT (line 774) fields.
\item PROJECT\_NAME should be replaced with the name of the program you are documenting.
\item INPUT should list all of the source files you wish to be included in the documentation. Alternatively, you can
list a directory as INPUT and use FILE\_PATTERNS (line 799) to determine which files will be included.\\[10pt]
\item There are several other options you can use to customize your generated documentation. Refer to \url{http://www.stack.nl/~dimitri/doxygen/manual/config.html}.
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Document Generation}
\begin{itemize}
\item Documentation is generated using the following command:
\begin{lstlisting}
doxygen configFileName
\end{lstlisting}
\item HTML and LaTeX documentation are default generated outputs.
\item By default, the HTML documentation will be found in a new directory called html: look for index.html.
\item The LaTeX documentation will be found in a new directory called latex. This folder will contain a makefile -- you must call make to generate a pdf which will be called refman.pdf by default.
\end{itemize}
\end{frame}
\begin{frame}[fragile]
\frametitle{Reference}
\begin{itemize}
\item Refer to the Doxygen documentation (\url{http://www.stack.nl/~dimitri/doxygen/manual/index.html}) for further details about using Doxygen.
\end{itemize}
\end{frame}
% Define Document Class
% Class Options Include:
% notes, notesonly, handout, trans,
% hidesubsections, shadesubsections,
% inrow, blue, red, grey, brown
%--------------------------------------------------------------------------
\documentclass[xcolor=dvipsnames, shownotes, colorlinks]{beamer}
%--------------------------------------------------------------------------
% Define Package Theme
%--------------------------------------------------------------------------
\usepackage{color}
\usepackage[T1]{fontenc}
%% \usepackage{fix-cm}
\usepackage{hyperref}
\hypersetup{
urlcolor=cyan,
linkcolor=white
}
\usepackage{subfigure}
%% \usepackage{xspace}
\usepackage{}
\usepackage{enumerate}
\usetheme{Antibes}
\setbeamertemplate{sidebar}[right]
\usepackage{listings} % Code formatting
%% \usepackage{framed}
%% \usepackage{booktabs}
\usepackage{tabularx}
\usepackage{marvosym}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{arrows}
\usetikzlibrary{calc,positioning}
\lstset{
language=Python,
basicstyle=\ttfamily\scriptsize,
tabsize=2,
breaklines=true,
prebreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
frame=single,
showstringspaces=true,
showspaces=false,
keywordstyle=\color{blue},
stringstyle=\color{magenta},
commentstyle=\color{ForestGreen},
literate={\#}{{\textcolor{ForestGreen}{\#}}}1 {@}{{\textcolor{blue}{\MVAt}}}1 {\$}{\vdots}1
}
%--------------------------------------------------------------------------
% Commands
%------------------------------------------------------------------------------
\newcommand*\oldmacro{}%
\let\oldmacro\insertshorttitle%
\renewcommand*\insertshorttitle{%
\oldmacro\hfill%
\insertframenumber\,/\,\inserttotalframenumber}
% Figure Source
\usepackage[absolute,overlay]{textpos}
\setbeamercolor{framesource}{fg=gray}
\setbeamerfont{framesource}{size=\tiny}
\newcommand{\source}[1]{\begin{textblock*}{\paperwidth}(-5pt,\textheight)
\begin{beamercolorbox}[ht=0.5cm,right]{framesource}
\usebeamerfont{framesource}\usebeamercolor[fg]{framesource} Source: {#1}
\end{beamercolorbox}
\end{textblock*}}
%------------------------------------------------------------------------------
% Presentation Title Slide
%--------------------------------------------------------------------------
\title{Generating Documentation with Doxygen}
\subtitle{CS 2ME3/SE 2AA4}
\author{Steven Palmer}
\institute{Department of Computing and Software\\
McMaster University\\ }
\date{January 8 - 12}
%--------------------------------------------------------------------------
% Document
% To add notes to the slides use: \note{}
% Add \section{} or \subsection{} for use in table of contents
%--------------------------------------------------------------------------
\begin{document}
% Create Title Slide
\begin{frame}[t]
\maketitle
\end{frame}
\section[Outline]{}
% Create Table of Contents Slide - Outline
\begin{frame}[t]
\frametitle{Outline}
{\hypersetup{linkcolor=black}
\tableofcontents
}
\end{frame}
\section{What is Doxygen?}
\begin{frame}[t]
\frametitle{What is Doxygen?}
\begin{itemize} \item Doxygen is a tool used to generate documentation for code modules/classes.
\item Comments with special syntax are used in source files to mark information that Doxygen should use.
\item When Doxygen is run, it extracts the marked information from the source file(s) and compiles it into selected output formats.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t]
\frametitle{Doxygen Information Flow}
\begin{center}
\includegraphics[width=.7\textwidth]{image/doxy.png}
\end{center}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t]
\frametitle{Doxygen Information Flow}
\begin{center}
\includegraphics[width=.7\textwidth]{image/doxy_subset.png}
\end{center}
\begin{itemize}
\item We will focus on the generation of LaTeX and HTML documentation.
\end{itemize}
\end{frame}
\section{Prerequisite Software}
% -----------------------------------------------------
\begin{frame}[t]
\frametitle{Installing TeX Distribution}
\begin{itemize}
\item You will need a \texttt{TeX} distribution.
\begin{itemize} \item TeX Live is recommended.
\item For Ubuntu-based Linux distributions you can install via \texttt{apt-get install texlive-full}.
\item For other operating systems see \href{https://www.tug.org/texlive/}{installation details}.
\end{itemize}
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t]
\frametitle{Installing Graphviz}
\begin{itemize}
\item Doxygen uses \texttt{dot}, which is part of the graphviz suite of graph visualization tools.
\begin{itemize} \item For Ubuntu-based Linux distributions you can install via \texttt{apt-get install graphviz}.
\item For other operating systems see \href{http://www.graphviz.org/}{installation details}.
\item Depending on your operating system, you may need to add the graphviz bin folder to your path so that \texttt{dot}
can be accessed via the command-line.
\end{itemize}
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t]
\frametitle{Installing Make}
\begin{itemize}
\item You will need \texttt{make} to build a pdf from the Doxygen LaTeX output.
\begin{itemize} \item \texttt{make} should be available by default on Linux systems.
\item If you are using OS X and \texttt{make} is not available, you will need to install the Command Line Tools package provided by Apple.
\item If you are using Windows, you should install the \href{http://www.mingw.org/}{MinGW environment}. Make sure to add the MinGW bin folder to your path so that \texttt{make} is runnable from the command-line.
\end{itemize}
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t]
\frametitle{Installing Doxygen}
\begin{itemize}
\item Finally, you will of course need to install \texttt{Doxygen} itself.
\begin{itemize} \item For Ubuntu-based Linux distributions you can install via \texttt{apt-get install doxygen}.
\item For other operating systems see \href{http://www.stack.nl/~dimitri/doxygen/download.html}{further installation instructions}.
\end{itemize}
\end{itemize}
\end{frame}
\section{Using Doxygen}
\subsection{Doxygen Style Comments}
% -----------------------------------------------------
\begin{frame}[t,fragile]
\frametitle{Doxygen Comments in Python}
\begin{itemize}
\item Doxygen comments in Python use the following simple structure:
\begin{lstlisting}
## @command1 args
# @command2 args
# @command3 args
$
# @commandn args
\end{lstlisting}
\item In general, a Doxygen comment block directly precedes either a class definition, a function definition, or a field definition.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t,fragile]
\frametitle{Documenting Classes}
\begin{itemize}
\item Python classes are documented as follows:
\begin{lstlisting}
## @brief A brief description of ClassX
# @details A more detailed description of ClassX
class ClassX:
...
\end{lstlisting}
\item Depending on the complexity of the class, {\MVAt}details may not be necessary.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t,fragile]
\frametitle{Documenting Functions}
\begin{itemize}
\item Python functions are documented as follows:
\begin{lstlisting}
## @brief A brief description of methodX
# @details A more detailed description of methodX
# @param p1 A description of parameter p1
# @param p2 A description of parameter p2
# @return A description of the returned value
def methodX(p1, p2):
...
return x
\end{lstlisting}
\item Depending on the complexity of the function, {\MVAt}details may not be necessary.
\item There should be an {\MVAt}param entry for every parameter of the function (possibly none). The parameter {\bf self} in class functions should be omitted.
\item {\MVAt}return is not necessary for void functions.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t,fragile]
\frametitle{Documenting Fields}
\begin{itemize}
\item Python fields are documented as follows:
\begin{lstlisting}
## A brief description of fieldX
fieldX = ...
\end{lstlisting}
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t,fragile]
\frametitle{Example}
\begin{itemize}
\item See Box3D.py for a small example of Python code with Doxygen style comments.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t,fragile]
\frametitle{Additional Commands}
\begin{itemize}
\item The Doxygen snippets given in this tutorial as well as the Box3D.py example file provide the basics for documenting your code.
\item Sometimes you may want to use additional commands to capture more details in your documentation.
\item Consult the \href{http://www.stack.nl/~dimitri/doxygen/manual/commands.html}{command documentation} for the full listing of available documentation commands and descriptions.
\end{itemize}
\end{frame}
\subsection{Building the Documentation}
% -----------------------------------------------------
\begin{frame}[t,fragile]
\frametitle{Configuration File}
\begin{itemize}
\item Producing documentation for a given set of source files with Doxygen requires a configuration file.
\item A default configuration file can be generated via the command line with:
\begin{lstlisting}
doxygen -g configFileName
\end{lstlisting}
\item configFileName can be whatever you want.
\item The configuration file needs to be edited to define your project.
\end{itemize}
\end{frame}
% -----------------------------------------------------
\begin{frame}[t,fragile]
\frametitle{Configuration File}
\begin{itemize}
\item Of particular importance for a new configuration are the PROJECT\_NAME (line 35) and INPUT (line 774) fields.
\item PROJECT\_NAME should be replaced with the name of the program you are documenting.
\item INPUT should list all of the source files you wish to be included in the documentation. Alternatively, you can
list a directory as INPUT and use FILE\_PATTERNS (line 799) to determine which files will be included.\\[10pt]
\item There are several other options you can use to customize your generated documentation (refer to \href{http://www.stack.nl/~dimitri/doxygen/manual/config.html}{config documentation}).
\end{itemize}
\end{frame}
\begin{frame}[t,fragile]
\frametitle{Document Generation}
\begin{itemize}
\item Documentation is generated using the following command:
\begin{lstlisting}
doxygen configFileName
\end{lstlisting}
\item HTML and LaTeX documentation are default generated outputs.
\item By default, the HTML documentation will be found in a new directory called html: look for index.html.
\item The LaTeX documentation will be found in a new directory called latex. This folder will contain a makefile -- you must call make to generate a pdf which will be called refman.pdf by default.
\end{itemize}
\end{frame}
\begin{frame}[t,fragile]
\frametitle{Reference}
\begin{itemize}
\item Refer to the \href{http://www.stack.nl/~dimitri/doxygen/manual/index.html}{Doxygen documentation} for further details about using Doxygen.
\end{itemize}
\end{frame}
\end{document}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment