\section{Module \ocamlinlinecode{Markup}}\label{Markup}%
Here, we test the rendering of comment markup.

\subsection{Sections\label{Markup--sections}}%
Let's get these done first, because sections will be used to break up the rest of this test.

Besides the section heading above, there are also

\subsubsection{Subsection headings\label{Markup--subsection-headings}}%
and

\subsubsection{Sub-subsection headings\label{Markup--sub-subsection-headings}}%
but odoc has banned deeper headings. There are also title headings, but they are only allowed in mld files.

\subsubsection{Anchors\label{Markup--anchors}}%
Sections can have attached \hyperref[Markup--anchors]{\ocamlinlinecode{Anchors}[p\pageref*{Markup--anchors}]}, and it is possible to \hyperref[Markup--anchors]{\ocamlinlinecode{link}[p\pageref*{Markup--anchors}]} to them. Links to section headers should not be set in source code style.

\subsubsection{Paragraph\label{Markup--paragraph}}%
Individual paragraphs can have a heading.

\subsubsection{Subparagraph\label{Markup--subparagraph}}%
Parts of a longer paragraph that can be considered alone can also have headings.

\subsection{Styling\label{Markup--styling}}%
This paragraph has some styled elements: \bold{bold} and \emph{italic}, \bold{\emph{bold italic}}, \emph{emphasis}, \emph{\emph{emphasis} within emphasis}, \bold{\emph{bold italic}}, super\textsuperscript{script}, sub\textsubscript{script}. The line spacing should be enough for superscripts and subscripts not to look odd.

Note: \emph{In italics \emph{emphasis} is rendered as normal text while \emph{emphasis \emph{in} emphasis} is rendered in italics.} \emph{It also work the same in \href{\#}{links in italics with \emph{emphasis \emph{in} emphasis}.}\footnote{\url{\#}}}

\ocamlinlinecode{code} is a different kind of markup that doesn't allow nested markup.

It's possible for two markup elements to appear \bold{next} \emph{to} each other and have a space, and appear \bold{next}\emph{to} each other with no space. It doesn't matter \bold{how} \emph{much} space it was in the source: in this sentence, it was two space characters. And in this one, there is \bold{a} \emph{newline}.

This is also true between \emph{non-}\ocamlinlinecode{code} markup \emph{and} \ocamlinlinecode{code}.

Code can appear \bold{inside \ocamlinlinecode{other} markup}. Its display shouldn't be affected.

There is no differences between \ocamlinlinecode{a b} and \ocamlinlinecode{a b}.

Consecutive whitespaces not after a newline are conserved as they are: \ocamlinlinecode{a   b}.

\subsection{Links and references\label{Markup--links-and-references}}%
This is a \href{\#}{link}\footnote{\url{\#}}. It sends you to the top of this page. Links can have markup inside them: \href{\#}{\bold{bold}}\footnote{\url{\#}}, \href{\#}{\emph{italics}}\footnote{\url{\#}}, \href{\#}{\emph{emphasis}}\footnote{\url{\#}}, \href{\#}{super\textsuperscript{script}}\footnote{\url{\#}}, \href{\#}{sub\textsubscript{script}}\footnote{\url{\#}}, and \href{\#}{\ocamlinlinecode{code}}\footnote{\url{\#}}. Links can also be nested \emph{\href{\#}{inside}\footnote{\url{\#}}} markup. Links cannot be nested inside each other. This link has no replacement text: \href{\#}{\#}\footnote{\url{\#}}. The text is filled in by odoc. This is a shorthand link: \href{\#}{\#}\footnote{\url{\#}}. The text is also filled in by odoc in this case.

This is a reference to \hyperref[Markup--val-foo]{\ocamlinlinecode{\ocamlinlinecode{foo}}[p\pageref*{Markup--val-foo}]}. References can have replacement text: \hyperref[Markup--val-foo]{\ocamlinlinecode{the value foo}[p\pageref*{Markup--val-foo}]}. Except for the special lookup support, references are pretty much just like links. The replacement text can have nested styles: \hyperref[Markup--val-foo]{\ocamlinlinecode{\bold{bold}}[p\pageref*{Markup--val-foo}]}, \hyperref[Markup--val-foo]{\ocamlinlinecode{\emph{italic}}[p\pageref*{Markup--val-foo}]}, \hyperref[Markup--val-foo]{\ocamlinlinecode{\emph{emphasis}}[p\pageref*{Markup--val-foo}]}, \hyperref[Markup--val-foo]{\ocamlinlinecode{super\textsuperscript{script}}[p\pageref*{Markup--val-foo}]}, \hyperref[Markup--val-foo]{\ocamlinlinecode{sub\textsubscript{script}}[p\pageref*{Markup--val-foo}]}, and \hyperref[Markup--val-foo]{\ocamlinlinecode{\ocamlinlinecode{code}}[p\pageref*{Markup--val-foo}]}. It's also possible to surround a reference in a style: \bold{\hyperref[Markup--val-foo]{\ocamlinlinecode{\ocamlinlinecode{foo}}[p\pageref*{Markup--val-foo}]}}. References can't be nested inside references, and links and references can't be nested inside each other.

\subsection{Preformatted text\label{Markup--preformatted-text}}%
This is a code block:\medbreak
\begin{ocamlcodeblock}
    let foo = ()
    (** There are some nested comments in here, but an unpaired comment
        terminator would terminate the whole doc surrounding comment. It's
        best to keep code blocks no wider than 72 characters. *)

    let bar =
      ignore foo
\end{ocamlcodeblock}\medbreak
There are also verbatim blocks:

\begin{verbatim}The main difference is these don't get syntax highlighting.\end{verbatim}%
\subsection{Lists\label{Markup--lists}}%
\begin{itemize}\item{This is a}%
\item{shorthand bulleted list,}%
\item{and the paragraphs in each list item support \emph{styling}.}\end{itemize}%
\begin{enumerate}\item{This is a}%
\item{shorthand numbered list.}\end{enumerate}%
\begin{itemize}\item{Shorthand list items can span multiple lines, however trying to put two paragraphs into a shorthand list item using a double line break}\end{itemize}%
just creates a paragraph outside the list.

\begin{itemize}\item{Similarly, inserting a blank line between two list items}\end{itemize}%
\begin{itemize}\item{creates two separate lists.}\end{itemize}%
\begin{itemize}\item{To get around this limitation, one

can use explicitly-delimited lists.

}%
\item{This one is bulleted,}\end{itemize}%
\begin{enumerate}\item{but there is also the numbered variant.}\end{enumerate}%
\begin{itemize}\item{\begin{itemize}\item{lists}%
\item{can be nested}%
\item{and can include references}%
\item{\hyperref[Markup--val-foo]{\ocamlinlinecode{\ocamlinlinecode{foo}}[p\pageref*{Markup--val-foo}]}}\end{itemize}%
}\end{itemize}%
\subsection{Unicode\label{Markup--unicode}}%
The parser supports any ASCII-compatible encoding.

In particuλar UTF-8.

\subsection{Raw HTML\label{Markup--raw-html}}%
Raw HTML can be  as inline elements into sentences.

\subsection{Math\label{Markup--math}}%
Math elements can be inline: $\int_{-\infty}^\infty$, or blocks:

\begin{equation*}
    % \f is defined as #1f(#2) using the macro
    \newcommand{\f}[2]{#1f(#2)}
    \f\relax{x} = \int_{-\infty}^\infty
    \f\hat\xi\,e^{2 \pi i \xi x}
    \,d\xi
\end{equation*}

\subsection{Modules\label{Markup--modules}}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{\hyperref[Markup-X]{\ocamlinlinecode{\ocamlinlinecode{X}}[p\pageref*{Markup-X}]}}]{}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{\hyperref[Markup-X]{\ocamlinlinecode{\ocamlinlinecode{X}}[p\pageref*{Markup-X}]}}]{}%
\item[{\hyperref[Markup-Y]{\ocamlinlinecode{\ocamlinlinecode{Y}}[p\pageref*{Markup-Y}]}}]{}\end{description}%
\subsection{Tables\label{Markup--tables}}\\
\begin{ocamltabular}{w{l}{0.250\textwidth}w{c}{0.250\textwidth}w{r}{0.250\textwidth}p{0.250\textwidth}}\bold{Left

}& \bold{Center

}& \bold{Right

}& \bold{Default

}\\
A

& B

& C

& D

\\
\end{ocamltabular}%
\\
\\
\begin{ocamltabular}{w{l}{0.250\textwidth}w{c}{0.250\textwidth}w{r}{0.250\textwidth}p{0.250\textwidth}}\bold{Left

}& \bold{Center

}& \bold{Right

}& \bold{Default

}\\
A

& B

& C

& D

\\
A much longer paragraph which will need to be wrapped and more content and more content and some different content and we will see what is does if we can see it

& B much longer paragraph which will need to be wrapped and more content and more content and some different content and we will see what is does if we can see it

& C much longer paragraph which will need to be wrapped and more content and more content and some different content and we will see what is does if we can see it

& D much longer paragraph which will need to be wrapped and more content and more content and some different content and we will see what is does if we can see it

\\
\end{ocamltabular}%
\\
\\
\begin{ocamltabular}{p{0.500\textwidth}p{0.500\textwidth}}No

& Header

\\
A

& B

\\
\end{ocamltabular}%
\\
\\
\begin{ocamltabular}{p{0.500\textwidth}p{0.500\textwidth}}\bold{Header 1

}& \bold{Header 2

}\\
Data 1

& Data 2

\\
\end{ocamltabular}%
\\
\\
\begin{ocamltabular}{p{0.500\textwidth}p{0.500\textwidth}}\bold{Header 1

}& Data 1

\\
\bold{Header 2

}& Data 2

\\
\end{ocamltabular}%
\\
\subsection{Tags\label{Markup--tags}}%
Each comment can end with zero or more tags. Here are some examples:

\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{author}]{antron}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{deprecated}]{a \emph{long} time ago

}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{parameter foo}]{unused

}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{raises \ocamlinlinecode{Failure}}]{always

}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{returns}]{never

}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{see \href{\#}{\#}\footnote{\url{\#}}}]{this url

}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{see \ocamlinlinecode{foo.\allowbreak{}ml}}]{this file

}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{see Foo}]{this document

}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{since}]{0}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{before 1.0}]{it was in b\textsuperscript{e}t\textsubscript{a}

}\end{description}%
\begin{description}\kern-\topsep
\makeatletter\advance\@topsepadd-\topsep\makeatother% topsep is hardcoded
\item[{version}]{-1}\end{description}%
\label{Markup--val-foo}\ocamlcodefragment{\ocamltag{keyword}{val} foo : unit}\begin{ocamlindent}Comments in structure items \bold{support} \emph{markup}, t\textsuperscript{o}\textsubscript{o}.\end{ocamlindent}%
\medbreak
Some modules to support references.

\label{Markup--module-X}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Markup-X]{\ocamlinlinecode{X}}}\label{Markup-X}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\end{ocamlindent}%
\ocamlcodefragment{\ocamltag{keyword}{end}}\\
\label{Markup--module-Y}\ocamlcodefragment{\ocamltag{keyword}{module} \hyperref[Markup-Y]{\ocamlinlinecode{Y}}}\label{Markup-Y}\ocamlcodefragment{ : \ocamltag{keyword}{sig}}\begin{ocamlindent}\end{ocamlindent}%
\ocamlcodefragment{\ocamltag{keyword}{end}}\\


