Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manual: document ocamldoc paragraph insertion #10402

Merged
merged 1 commit into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ OCaml 4.13.0

### Manual and documentation:

- #9525, #10402: ocamldoc only create paragraphq at the toplevel of
documentation comments
(Florian Angeletti, report by Hendrik Tews, review by Gabriel Scherer)

- #10247: Add initial tranche of examples to reference manual.
Adds some eighty examples to the reference manual, principally to the
expressions and patterns sections.
Expand Down
44 changes: 30 additions & 14 deletions manual/src/cmds/ocamldoc.etex
Original file line number Diff line number Diff line change
Expand Up @@ -731,27 +731,44 @@ text: {{text-element}}
;
\end{syntax}


\begin{syntax}
inline-text: {{inline-text-element}}
;
\end{syntax}


\noindent
\begin{syntaxleft}
\nonterm{text-element}\is{}
\end{syntaxleft}

\begin{tabular}{rlp{10cm}}
@||@&@ '{' {{ "0" \ldots "9" }} text '}' @ & format @text@ as a section header;
@||@& @inline-text-element@ & \\
@||@& \nt{blank-line} & force a new line. \\
\end{tabular}\\

\noindent
\begin{syntaxleft}
\nonterm{inline-text-element}\is{}
\end{syntaxleft}

\begin{tabular}{rlp{10cm}}
@||@&@ '{' {{ "0" \ldots "9" }} inline-text '}' @ & format @text@ as a section header;
the integer following "{" indicates the sectioning level. \\
@||@&@ '{' {{ "0" \ldots "9" }} ':' @ \nt{label} @ text '}' @ &
@||@&@ '{' {{ "0" \ldots "9" }} ':' @ \nt{label} @ inline-text '}' @ &
same, but also associate the name \nt{label} to the current point.
This point can be referenced by its fully-qualified label in a
"{!" command, just like any other element. \\
@||@&@ '{b' text '}' @ & set @text@ in bold. \\
@||@&@ '{i' text '}' @ & set @text@ in italic. \\
@||@&@ '{e' text '}' @ & emphasize @text@. \\
@||@&@ '{C' text '}' @ & center @text@. \\
@||@&@ '{L' text '}' @ & left align @text@. \\
@||@&@ '{R' text '}' @ & right align @text@. \\
@||@&@ '{b' inline-text '}' @ & set @text@ in bold. \\
@||@&@ '{i' inline-text '}' @ & set @text@ in italic. \\
@||@&@ '{e' inline-text '}' @ & emphasize @text@. \\
@||@&@ '{C' inline-text '}' @ & center @text@. \\
@||@&@ '{L' inline-text '}' @ & left align @text@. \\
@||@&@ '{R' inline-text '}' @ & right align @text@. \\
@||@&@ '{ul' list '}' @ & build a list. \\
@||@&@ '{ol' list '}' @ & build an enumerated list. \\
@||@&@ '{{:' string '}' text '}' @ & put a link to the given address
@||@&@ '{{:' string '}' inline-text '}' @ & put a link to the given address
(given as @string@) on the given @text@. \\
@||@&@ '[' string ']' @ & set the given @string@ in source code style. \\
@||@&@ '{[' string ']}' @ & set the given @string@ in preformatted
Expand All @@ -766,20 +783,19 @@ text: {{text-element}}
for the given module names. Used in HTML only.\\
@||@&@ '{!indexlist}' @ & insert a table of links to the various indexes
(types, values, modules, ...). Used in HTML only.\\
@||@&@ '{^' text '}' @ & set text in superscript.\\
@||@&@ '{_' text '}' @ & set text in subscript.\\
@||@&@ '{^' inline-text '}' @ & set text in superscript.\\
@||@&@ '{_' inline-text '}' @ & set text in subscript.\\
@||@& \nt{escaped-string} & typeset the given string as is;
special characters ('"{"', '"}"', '"["', '"]"' and '"\@"')
must be escaped by a '"\\"'\\
@||@& \nt{blank-line} & force a new line.
\end{tabular} \\

\subsubsection{sss:ocamldoc-list}{List formatting}

\begin{syntax}
list:
| {{ '{-' text '}' }}
| {{ '{li' text '}' }}
| {{ '{-' inline-text '}' }}
| {{ '{li' inline-text '}' }}
\end{syntax}

A shortcut syntax exists for lists and enumerated lists:
Expand Down