Skip to content

Commit

Permalink
Merge pull request #10402 from Octachron/manual_ocamldoc_fix
Browse files Browse the repository at this point in the history
manual: document ocamldoc paragraph insertion
(cherry picked from commit e5e9c5f)
  • Loading branch information
Octachron committed Jun 17, 2021
1 parent cf8c22e commit 234ca13
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,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

0 comments on commit 234ca13

Please sign in to comment.