package odoc

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Cheatsheet

Quick reference for the odoc language!

odoc syntax

Render as

Paragraphs

A first paragraph

A second paragraph

A first paragraph

A second paragraph

Headings

{1 Title}
{2 Subtitle}
{3 Subsubtitle}

{3:my_id Referenceable title}

See {!my_id}.

Standalone pages must start with a 0 heading:

{0 Page big title}

Title

Subtitle

Subsubtitle

Referenceable title

See Referenceable title

Bold, italic and emphasis

{b bold} text, {i italic} text, {e emphasized} text

bold text, italic text, emphasized text

Subscripts and superscript

H{_ 2}O and 1{^ st}

H2O and 1st

Link

Here is a link: {:https://www.example.com}.

You can also click {{:https://www.example.com}here}.

Here is a link: https://www.example.com.

You can also click here.

References

See {!Odoc_odoc.Compile.compile}.

See {{!Odoc_odoc.Compile.compile}this function}.

See {{!odoc_for_authors.links_and_references}this section} for the syntax of references.

See Odoc_odoc.Compile.compile.

See this function.

See this section for the syntax of references.

Lists

- First item
- Second item

+ First ordered item
+ Second numbered item

{ul
  {- First item}
  {- Second item}
  {li can also be used}}

{ol
  {- First numbered item}
  {- Second numbered item}
  {li can also be used}}
  • First item
  • Second item
  1. First ordered item
  2. Second numbered item
  • First item
  • Second item
  • can also be used
  1. First numbered item
  2. Second numbered item
  3. can also be used

Code Blocks

Inline [code].

{[
  let _ = "Block code"
]}

{foo@text[
  Code block with {[inner code block syntax]}
]foo}

{@python[
  [i+1 for i in xrange(2)]
]}

Inline code.

let _ = "Block code"
Code block with {[inner code block syntax]}
[i+1 for i in xrange(2)]

Verbatim

{v verbatim text v}
verbatim text

Math

For inline math: {m \sqrt 2}.

For display math:

{math \sqrt 2}

For inline math: \sqrt 2.

For display math:

\sqrt 2

Table

Light syntax:

{t | Header 1 | Header 2 |
   |----------|----------|
   | Cell 1   | Cell 2   |
   | Cell 3   | Cell 4   |}

Explicit syntax:

{table
  {tr
    {th Header 1}
    {th Header 2}}
  {tr
    {td Cell 1}
    {td Cell 2}}
  {tr
    {td Cell 3}
    {td Cell 4}}}

Light syntax:

Header 1

Header 2

Cell 1

Cell 2

Cell 3

Cell 4

Explicit syntax:

Header 1

Header 2

Cell 1

Cell 2

Cell 3

Cell 4

HTML

{%html:
  <blockquote>
    Odoc language lack support for quotation!
  </blockquote>
%}
Odoc language lack support for quotation!

Tags

@since 4.08

Tags are explained in {{!page-odoc_for_authors.tags}this section}.

Since 4.08.

Tags are explained in this section.

OCaml

Innovation. Community. Security.