File: cheatsheet.mld

package info (click to toggle)
ocaml-odoc 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,008 kB
  • sloc: ml: 60,567; javascript: 2,572; sh: 566; makefile: 31
file content (257 lines) | stat: -rw-r--r-- 5,486 bytes parent folder | download | duplicates (2)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
{0 Cheatsheet}

Quick reference for the odoc language!

{table
  {tr
    {th }
    {th [odoc] syntax}
    {th Render as}}
  {tr
    {th Paragraphs}
    {td
      {@text[
      A first paragraph

      A second paragraph]}}
    {td
      A first paragraph

      A second paragraph}}
  {tr
    {th {{!odoc_for_authors.sections}Headings}}
    {td
      {@text[
      {1 Title}
      {2 Subtitle}
      {3 Subsubtitle}

      {3:my_id Referenceable title}

      See {!my_id}.
      ]}

      Standalone pages must start with a [0] heading:

      {@text[
        {0 Page big title}
      ]}}
    {td
      {%html:<h1>Title</h1>%}
      {%html:<h2>Subtitle</h2>%}
      {%html:<h3>Subsubtitle</h3>%}
      {%html:<h3 id="my_id">Referenceable title</h3>%}

      See {%html:<a href="#my_id">Referenceable title</a>%}}}
  {tr
    {th {{!odoc_for_authors.basics}Bold, italic and emphasis}}
    {td {@text[{b bold} text, {i italic} text, {e emphasized} text]}}
    {td   {b bold} text, {i italic} text, {e emphasized} text}}
  {tr
    {th {{!odoc_for_authors.basics}Subscripts and superscript}}
    {td {@text[H{_ 2}O and 1{^ st}]}}
    {td   H{_ 2}O and 1{^ st}}}
  {tr
    {th {{!odoc_for_authors.links_and_references}Link} }
    {td
      {@text[
      Here is a link: {:https://www.example.com}.

      You can also click {{:https://www.example.com}here}.]}}
    {td
      Here is a link: {:https://www.example.com}.

      You can also click {{:https://www.example.com}here}.}}
  {tr
    {th {{!odoc_for_authors.links_and_references}References} }
    {td
      {@text[
      See {!Odoc_odoc.Compile.compile}.

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

      See {{!/fmt/Fmt.pf}this function from another library}.

      See {{!/cmdliner/tutorial}this page from another package}.

      See {{!odoc_for_authors.links_and_references}this section} for the syntax of references.]}}
    {td
      See {!Odoc_odoc.Compile.compile}.

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

      See {{!/fmt/Fmt.pf}this function from another library}.

      See {{!/cmdliner/tutorial}this page from another package}.

      See {{!odoc_for_authors.links_and_references}this section} for the syntax of references.}}
    {tr
      {th {{!odoc_for_authors.lists}Lists} }
    {td
      {@text[
      - 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}}]}}
    {td
      - 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}}}}
  {tr
    {th {{!odoc_for_authors.code_blocks}Code Blocks} }
    {td
      {example@text[
      Inline [code].

      {[
      let _ = "Block code"
      ]}

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

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

      Inline [code].

      {[
      let _ = "Block code"
      ]}

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

      {@python[
      [i+1 for i in xrange(2)]
      ]}}}
  {tr
    {th {{!odoc_for_authors.verbatim_blocks}Verbatim} }
    {td
      {example@text[
      {v verbatim text v}]example}}
    {td {v verbatim text v}}}
  {tr
    {th {{!odoc_for_authors.math}Math} }
    {td
      {@text[
      For inline math: {m \sqrt 2}.

      For display math:

      {math \sqrt 2}]}}
    {td
      For inline math: {m \sqrt 2}.

      For display math:

      {math \sqrt 2}}}
  {tr
    {th {{!odoc_for_authors.media}Images} }
    {td
      {@text[
      {image!path/to/file.png}

      {image:https://picsum.photos/200/100}
    ]}}
    {td
      {image!odoc_logo_placeholder.jpg}

      {image:https://picsum.photos/200/100}
    }}
  {tr
    {th {{!odoc_for_authors.tables}Table} }
    {td
      {@text[
      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}}}]}}
    {td
      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}}}}}
  {tr
    {th HTML }
    {td
      {example@text[
      {%html:
        <blockquote>
          Odoc language lack support for quotation!
        </blockquote>
      %}]example}}
    {td
      {%html:
        <blockquote>
          Odoc language lack support for quotation!
        </blockquote>
      %}}}
  {tr
    {th {{!page-odoc_for_authors.tags}Tags} }
    {td
      {example@text[
      @since 4.08

      Tags are explained in {{!page-odoc_for_authors.tags}this section}.]example}}
    {td
      Since 4.08.

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