\documentclass{report}
\usepackage{hyperref}
% WARNING: THIS SHOULD BE MODIFIED DEPENDING ON THE LETTER/A4 SIZE
\oddsidemargin 0cm
\evensidemargin 0cm
\marginparsep 0cm
\marginparwidth 0cm
\parindent 0cm
\textwidth 16.5cm

\ifpdf
  \usepackage[pdftex]{graphicx}
\else
  \usepackage[dvips]{graphicx}
\fi

% definitons for warning and note tag
\usepackage[most]{tcolorbox}
\newtcolorbox{tcbwarning}{
 breakable,
 enhanced jigsaw,
 top=0pt,
 bottom=0pt,
 titlerule=0pt,
 bottomtitle=0pt,
 rightrule=0pt,
 toprule=0pt,
 bottomrule=0pt,
 colback=white,
 arc=0pt,
 outer arc=0pt,
 title style={white},
 fonttitle=\color{black}\bfseries,
 left=8pt,
 colframe=red,
 title={Warning:},
}
\newtcolorbox{tcbnote}{
 breakable,
 enhanced jigsaw,
 top=0pt,
 bottom=0pt,
 titlerule=0pt,
 bottomtitle=0pt,
 rightrule=0pt,
 toprule=0pt,
 bottomrule=0pt,
 colback=white,
 arc=0pt,
 outer arc=0pt,
 title style={white},
 fonttitle=\color{black}\bfseries,
 left=8pt,
 colframe=yellow,
 title={Note:},
}

\begin{document}
% special variable used for calculating some widths.
\newlength{\tmplength}
\chapter{Unit ok{\_}include{\_}environment}
\section{Description}
Test of handling the "\textit{{\$}I or {\$}INCLUDE : Include compiler info}" feature of FPC, see [http://www.freepascal.org/docs-html/prog/progsu38.html].\hfill\vspace*{1ex}



PasDoc bug spotted by Michalis on 2005{-}12{-}04 when trying `make htmldocs' on fpc compiler sources, in file version.pas.

Notes about how it should be implemented in PasDoc :

PasDoc will \textit{not} expand these macros. Instead PasDoc will just explicitly show that e.g. value of MacDATE is {\%}DATE{\%}, value of MacFPCTARGET is {\%}FPCTARGET{\%} etc. Reasons: \begin{itemize}
\item For {\%}DATE{\%} and {\%}TIME{\%}, PasDoc could expand them, but it's not sensible. After all, at compilation they will be set to something different. So what PasDoc should do (and will) is to show user that the value of MacDATE is {\%}DATE{\%}.

This way user will know that MacDATE's value depends on time of compilation.
\item For {\%}FPC???{\%} macros, PasDoc couldn't expand them, even if it should. After all, we don't know what FPC version will be used to compile the given unit.
\item For {\%}environment{-}variable{\%}: argument like with {\%}FPC???{\%} macros: PasDoc is not able to predict what value {\$}environment{-}variable will have at compilation time.
\item Finally, for {\%}FILE{\%} and {\%}LINE{\%}: this is the only case when actually PasDoc could just expand them, just like FPC will.

For now, my decision is to not expand them, for consistency with handling all other {\%}xxx{\%}.
\end{itemize}
\section{Constants}
\subsection*{MacDATE}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacDATE = {\{}{\$}I {\%}DATE{\%}{\}};\end{ttfamily}


\end{flushleft}
\par
\item[\textbf{Description}]
Inserts the current date.

\end{list}
\subsection*{MacFPCTARGET}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacFPCTARGET = {\{}{\$}I {\%}FPCTARGET{\%}{\}};\end{ttfamily}


\end{flushleft}
\par
\item[\textbf{Description}]
Inserts the target CPU name. (deprecated, use FPCTARGETCPU)

\end{list}
\subsection*{MacFPCTARGETCPU}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacFPCTARGETCPU = {\{}{\$}I {\%}FPCTARGETCPU{\%}{\}};\end{ttfamily}


\end{flushleft}
\par
\item[\textbf{Description}]
Inserts the target CPU name.

\end{list}
\subsection*{MacFPCTARGETOS}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacFPCTARGETOS = {\{}{\$}I {\%}FPCTARGETOS{\%}{\}};\end{ttfamily}


\end{flushleft}
\par
\item[\textbf{Description}]
Inserts the target OS name.

\end{list}
\subsection*{MacFPCVERSION}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacFPCVERSION = {\{}{\$}I {\%}FPCVERSION{\%}{\}};\end{ttfamily}


\end{flushleft}
\par
\item[\textbf{Description}]
Current compiler version number.

\end{list}
\subsection*{MacFILE}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacFILE = {\{}{\$}I {\%}FILE{\%}{\}};\end{ttfamily}


\end{flushleft}
\par
\item[\textbf{Description}]
Filename in which the directive is found.

\end{list}
\subsection*{MacLINE}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacLINE = {\{}{\$}I {\%}LINE{\%}{\}};\end{ttfamily}


\end{flushleft}
\par
\item[\textbf{Description}]
Linenumer on which the directive is found.

\end{list}
\subsection*{MacTIME}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacTIME = {\{}{\$}I {\%}TIME{\%}{\}};\end{ttfamily}


\end{flushleft}
\par
\item[\textbf{Description}]
Current time.

\end{list}
\subsection*{MacUSEREnv}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacUSEREnv = {\{}{\$}I {\%}USER{\%}{\}};\end{ttfamily}


\end{flushleft}
\par
\item[\textbf{Description}]
If xxx inside {\%}xxx{\%} is none of the above, then it is assumed to be the name of an environment variable. Its value will be fetched.

\end{list}
\subsection*{MacPathEnv}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\begin{flushleft}
\item[\textbf{Declaration}\hfill]
\begin{ttfamily}
MacPathEnv = {\{}{\$}I {\%}PATH{\%}{\}};\end{ttfamily}


\end{flushleft}
\end{list}
\end{document}
