1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
Block delimiters should be on their own line:
{[
let x = 1
]}
As of odoc 2.1, a block can carry metadata:
{@ocaml[
let x = 2
]}
An OCaml block that should break:
{[
let x = 2 in
x + x
]}
A toplevel phrase with no output:
{[
# let x = 2 and y = 3 in x+y;;
]}
A toplevel phrase with output:
{[
# let x = 2;;
val x : int = 2
]}
Many toplevel phrases without output:
{[
# let x = 2;;
# x + 2;;
# let x = 2 and y = 3 in x+y;;
]}
Many toplevel phrases with output:
{[
# let x = 2;;
val x : int = 2
# x + 2;;
- : int = 4
# let x = 2 and y = 3 in x+y;;
]}
Output are printed after a newline:
{[
# let x = 2;; val x : int = 2
# let x = 3;;
# let x = 4;; val x : int = 4
]}
Excessive linebreaks are removed:
{[
# let x = 2 in x+1;;
output
# let y = 3 in y+1;;
]}
Linebreak after `#`:
{[
#
let x = 2 in x+1;;
]}
Invalid toplevel phrase/ocaml block:
{[
- : int =
4
]}
|