this repo has no description
at main 257 lines 5.5 kB view raw
1{0 Cheatsheet} 2 3Quick reference for the odoc language! 4 5{table 6 {tr 7 {th } 8 {th [odoc] syntax} 9 {th Render as}} 10 {tr 11 {th Paragraphs} 12 {td 13 {@text[ 14 A first paragraph 15 16 A second paragraph]}} 17 {td 18 A first paragraph 19 20 A second paragraph}} 21 {tr 22 {th {{!odoc_for_authors.sections}Headings}} 23 {td 24 {@text[ 25 {1 Title} 26 {2 Subtitle} 27 {3 Subsubtitle} 28 29 {3:my_id Referenceable title} 30 31 See {!my_id}. 32 ]} 33 34 Standalone pages must start with a [0] heading: 35 36 {@text[ 37 {0 Page big title} 38 ]}} 39 {td 40 {%html:<h1>Title</h1>%} 41 {%html:<h2>Subtitle</h2>%} 42 {%html:<h3>Subsubtitle</h3>%} 43 {%html:<h3 id="my_id">Referenceable title</h3>%} 44 45 See {%html:<a href="#my_id">Referenceable title</a>%}}} 46 {tr 47 {th {{!odoc_for_authors.basics}Bold, italic and emphasis}} 48 {td {@text[{b bold} text, {i italic} text, {e emphasized} text]}} 49 {td {b bold} text, {i italic} text, {e emphasized} text}} 50 {tr 51 {th {{!odoc_for_authors.basics}Subscripts and superscript}} 52 {td {@text[H{_ 2}O and 1{^ st}]}} 53 {td H{_ 2}O and 1{^ st}}} 54 {tr 55 {th {{!odoc_for_authors.links_and_references}Link} } 56 {td 57 {@text[ 58 Here is a link: {:https://www.example.com}. 59 60 You can also click {{:https://www.example.com}here}.]}} 61 {td 62 Here is a link: {:https://www.example.com}. 63 64 You can also click {{:https://www.example.com}here}.}} 65 {tr 66 {th {{!odoc_for_authors.links_and_references}References} } 67 {td 68 {@text[ 69 See {!Odoc_odoc.Compile.compile}. 70 71 See {{!Odoc_odoc.Compile.compile}this function}. 72 73 See {{!/fmt/Fmt.pf}this function from another library}. 74 75 See {{!/cmdliner/page-tutorial}this page from another package}. 76 77 See {{!odoc_for_authors.links_and_references}this section} for the syntax of references.]}} 78 {td 79 See {!Odoc_odoc.Compile.compile}. 80 81 See {{!Odoc_odoc.Compile.compile}this function}. 82 83 See {{!/fmt/Fmt.pf}this function from another library}. 84 85 See {{!/cmdliner/page-tutorial}this page from another package}. 86 87 See {{!odoc_for_authors.links_and_references}this section} for the syntax of references.}} 88 {tr 89 {th {{!odoc_for_authors.lists}Lists} } 90 {td 91 {@text[ 92 - First item 93 - Second item 94 95 + First ordered item 96 + Second numbered item 97 98 {ul 99 {- First item} 100 {- Second item} 101 {li can also be used}} 102 103 {ol 104 {- First numbered item} 105 {- Second numbered item} 106 {li can also be used}}]}} 107 {td 108 - First item 109 - Second item 110 111 + First ordered item 112 + Second numbered item 113 114 {ul 115 {- First item} 116 {- Second item} 117 {li can also be used}} 118 119 {ol 120 {- First numbered item} 121 {- Second numbered item} 122 {li can also be used}}}} 123 {tr 124 {th {{!odoc_for_authors.code_blocks}Code Blocks} } 125 {td 126 {example@text[ 127 Inline [code]. 128 129 {[ 130 let _ = "Block code" 131 ]} 132 133 {foo@text[ 134 Code block with {[inner code block syntax]} 135 ]foo} 136 137 {@python[ 138 [i+1 for i in xrange(2)] 139 ]}]example}} 140 {td 141 142 Inline [code]. 143 144 {[ 145 let _ = "Block code" 146 ]} 147 148 {foo@text[ 149 Code block with {[inner code block syntax]} 150 ]foo} 151 152 {@python[ 153 [i+1 for i in xrange(2)] 154 ]}}} 155 {tr 156 {th {{!odoc_for_authors.verbatim_blocks}Verbatim} } 157 {td 158 {example@text[ 159 {v verbatim text v}]example}} 160 {td {v verbatim text v}}} 161 {tr 162 {th {{!odoc_for_authors.math}Math} } 163 {td 164 {@text[ 165 For inline math: {m \sqrt 2}. 166 167 For display math: 168 169 {math \sqrt 2}]}} 170 {td 171 For inline math: {m \sqrt 2}. 172 173 For display math: 174 175 {math \sqrt 2}}} 176 {tr 177 {th {{!odoc_for_authors.media}Images} } 178 {td 179 {@text[ 180 {image!path/to/file.png} 181 182 {image:https://picsum.photos/200/100} 183 ]}} 184 {td 185 {image!/odoc/odoc_logo_placeholder.jpg} 186 187 {image:https://picsum.photos/200/100} 188 }} 189 {tr 190 {th {{!odoc_for_authors.tables}Table} } 191 {td 192 {@text[ 193 Light syntax: 194 195 {t | Header 1 | Header 2 | 196 |----------|----------| 197 | Cell 1 | Cell 2 | 198 | Cell 3 | Cell 4 |} 199 200 Explicit syntax: 201 202 {table 203 {tr 204 {th Header 1} 205 {th Header 2}} 206 {tr 207 {td Cell 1} 208 {td Cell 2}} 209 {tr 210 {td Cell 3} 211 {td Cell 4}}}]}} 212 {td 213 Light syntax: 214 215 {t | Header 1 | Header 2 | 216 |----------|----------| 217 | Cell 1 | Cell 2 | 218 | Cell 3 | Cell 4 |} 219 220 Explicit syntax: 221 222 {table 223 {tr 224 {th Header 1} 225 {th Header 2}} 226 {tr 227 {td Cell 1} 228 {td Cell 2}} 229 {tr 230 {td Cell 3} 231 {td Cell 4}}}}} 232 {tr 233 {th HTML } 234 {td 235 {example@text[ 236 {%html: 237 <blockquote> 238 Odoc language lack support for quotation! 239 </blockquote> 240 %}]example}} 241 {td 242 {%html: 243 <blockquote> 244 Odoc language lack support for quotation! 245 </blockquote> 246 %}}} 247 {tr 248 {th {{!page-odoc_for_authors.tags}Tags} } 249 {td 250 {example@text[ 251 @since 4.08 252 253 Tags are explained in {{!page-odoc_for_authors.tags}this section}.]example}} 254 {td 255 Since 4.08. 256 257 Tags are explained in {{!page-odoc_for_authors.tags}this section}.}}}