|
5 | 5 |
|
6 | 6 | This page is a small demonstration of Markdown support. |
7 | 7 |
|
| 8 | +The file is encoded in UTF-8 format with BOM (this is a UTF-8 symbol: €) |
| 9 | + |
8 | 10 | <https://www.markdownguide.org> |
9 | 11 |
|
10 | 12 | Referenced link: From [CommonMark]: |
@@ -56,321 +58,30 @@ end; |
56 | 58 | --- |
57 | 59 | ### Horizontal rule |
58 | 60 |
|
| 61 | +## Math formulas |
| 62 | + |
| 63 | +Inline formula written between single dollar signs: $E = mc^2$ rendered inside the text. |
| 64 | + |
| 65 | +Use double dollar signs for a centered formula block: |
| 66 | + |
| 67 | +$$\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ |
| 68 | + |
59 | 69 | ## Tables |
60 | 70 |
|
61 | 71 | | First Header | Second Header | Third Header | |
62 | 72 | | :----------- | :-----------: | -----------: | |
63 | 73 | | Left | Center | Right | |
64 | 74 | | Second row | **strong** | *italic* | |
65 | 75 |
|
66 | | -# Markdown: Syntax |
67 | | - |
68 | | -* [Overview](#overview) |
69 | | - * [Philosophy](#philosophy) |
70 | | - * [Inline HTML](#html) |
71 | | - * [Automatic Escaping for Special Characters](#autoescape) |
72 | | -* [Block Elements](#block) |
73 | | - * [Paragraphs and Line Breaks](#p) |
74 | | - * [Headers](#header) |
75 | | - * [Blockquotes](#blockquote) |
76 | | - * [Lists](#list) |
77 | | - * [Code Blocks](#precode) |
78 | | - * [Horizontal Rules](#hr) |
79 | | -* [Span Elements](#span) |
80 | | - * [Links](#link) |
81 | | - * [Emphasis](#em) |
82 | | - * [Code](#code) |
83 | | - * [Images](#img) |
84 | | -* [Miscellaneous](#misc) |
85 | | - * [Backslash Escapes](#backslash) |
86 | | - * [Automatic Links](#autolink) |
87 | | - |
88 | | - |
89 | | -**Note:** This document is itself written using Markdown; you |
90 | | -can [see the source for it by adding '.text' to the URL](/projects/markdown/syntax.text). |
91 | | - |
92 | | ----- |
93 | | - |
94 | | -## Overview |
95 | | - |
96 | | -### Philosophy |
97 | | - |
98 | | -Markdown is intended to be as easy-to-read and easy-to-write as is feasible. |
99 | | - |
100 | | -Readability, however, is emphasized above all else. A Markdown-formatted |
101 | | -document should be publishable as-is, as plain text, without looking |
102 | | -like it's been marked up with tags or formatting instructions. While |
103 | | -Markdown's syntax has been influenced by several existing text-to-HTML |
104 | | -filters -- including [Setext](http://docutils.sourceforge.net/mirror/setext.html), [atx](http://www.aaronsw.com/2002/atx/), [Textile](http://textism.com/tools/textile/), [reStructuredText](http://docutils.sourceforge.net/rst.html), |
105 | | -[Grutatext](http://www.triptico.com/software/grutatxt.html), and [EtText](http://ettext.taint.org/doc/) -- the single biggest source of |
106 | | -inspiration for Markdown's syntax is the format of plain text email. |
107 | | - |
108 | | -## Block Elements |
109 | | - |
110 | | -### Paragraphs and Line Breaks |
111 | | - |
112 | | -A paragraph is simply one or more consecutive lines of text, separated |
113 | | -by one or more blank lines. (A blank line is any line that looks like a |
114 | | -blank line -- a line containing nothing but spaces or tabs is considered |
115 | | -blank.) Normal paragraphs should not be indented with spaces or tabs. |
116 | | - |
117 | | -The implication of the "one or more consecutive lines of text" rule is |
118 | | -that Markdown supports "hard-wrapped" text paragraphs. This differs |
119 | | -significantly from most other text-to-HTML formatters (including Movable |
120 | | -Type's "Convert Line Breaks" option) which translate every line break |
121 | | -character in a paragraph into a `<br />` tag. |
122 | | - |
123 | | -When you *do* want to insert a `<br />` break tag using Markdown, you |
124 | | -end a line with two or more spaces, then type return. |
125 | | - |
126 | | -### Headers |
127 | | - |
128 | | -Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. |
129 | | - |
130 | | -Optionally, you may "close" atx-style headers. This is purely |
131 | | -cosmetic -- you can use this if you think it looks better. The |
132 | | -closing hashes don't even need to match the number of hashes |
133 | | -used to open the header. (The number of opening hashes |
134 | | -determines the header level.) |
135 | | - |
136 | | - |
137 | | -### Blockquotes |
138 | | - |
139 | | -Markdown uses email-style `>` characters for blockquoting. If you're |
140 | | -familiar with quoting passages of text in an email message, then you |
141 | | -know how to create a blockquote in Markdown. It looks best if you hard |
142 | | -wrap the text and put a `>` before every line: |
143 | | - |
144 | | -> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, |
145 | | -> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. |
146 | | -> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. |
147 | | -> |
148 | | -> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse |
149 | | -> id sem consectetuer libero luctus adipiscing. |
150 | | -
|
151 | | -Markdown allows you to be lazy and only put the `>` before the first |
152 | | -line of a hard-wrapped paragraph: |
153 | | - |
154 | | -> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, |
155 | | -consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. |
156 | | -Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. |
157 | | - |
158 | | -> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse |
159 | | -id sem consectetuer libero luctus adipiscing. |
160 | | - |
161 | | -Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by |
162 | | -adding additional levels of `>`: |
163 | | - |
164 | | -> This is the first level of quoting. |
165 | | -> |
166 | | -> > This is nested blockquote. |
167 | | -> |
168 | | -> Back to the first level. |
169 | | -
|
170 | | -Blockquotes can contain other Markdown elements, including headers, lists, |
171 | | -and code blocks: |
172 | | - |
173 | | -> ## This is a header. |
174 | | -> |
175 | | -> 1. This is the first list item. |
176 | | -> 2. This is the second list item. |
177 | | -> |
178 | | -> Here's some example code: |
179 | | -> |
180 | | -> return shell_exec("echo $input | $markdown_script"); |
181 | | -
|
182 | | -Any decent text editor should make email-style quoting easy. For |
183 | | -example, with BBEdit, you can make a selection and choose Increase |
184 | | -Quote Level from the Text menu. |
185 | | - |
186 | | - |
187 | | -### Lists |
188 | | - |
189 | | -Markdown supports ordered (numbered) and unordered (bulleted) lists. |
190 | | - |
191 | | -Unordered lists use asterisks, pluses, and hyphens -- interchangably |
192 | | --- as list markers: |
193 | | - |
194 | | -* Red |
195 | | -* Green |
196 | | -* Blue |
197 | | - |
198 | | -is equivalent to: |
199 | | - |
200 | | -+ Red |
201 | | -+ Green |
202 | | -+ Blue |
203 | | - |
204 | | -and: |
205 | | - |
206 | | -- Red |
207 | | -- Green |
208 | | -- Blue |
209 | | - |
210 | | -Ordered lists use numbers followed by periods: |
211 | | - |
212 | | -1. Bird |
213 | | -2. McHale |
214 | | -3. Parish |
215 | | - |
216 | | -It's important to note that the actual numbers you use to mark the |
217 | | -list have no effect on the HTML output Markdown produces. The HTML |
218 | | -Markdown produces from the above list is: |
219 | | - |
220 | | -If you instead wrote the list in Markdown like this: |
221 | | - |
222 | | -1. Bird |
223 | | -1. McHale |
224 | | -1. Parish |
225 | | - |
226 | | -or even: |
227 | | - |
228 | | -3. Bird |
229 | | -1. McHale |
230 | | -8. Parish |
231 | | - |
232 | | -you'd get the exact same HTML output. The point is, if you want to, |
233 | | -you can use ordinal numbers in your ordered Markdown lists, so that |
234 | | -the numbers in your source match the numbers in your published HTML. |
235 | | -But if you want to be lazy, you don't have to. |
236 | | - |
237 | | -To make lists look nice, you can wrap items with hanging indents: |
238 | | - |
239 | | -* Lorem ipsum dolor sit amet, consectetuer adipiscing elit. |
240 | | - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, |
241 | | - viverra nec, fringilla in, laoreet vitae, risus. |
242 | | -* Donec sit amet nisl. Aliquam semper ipsum sit amet velit. |
243 | | - Suspendisse id sem consectetuer libero luctus adipiscing. |
244 | | - |
245 | | -But if you want to be lazy, you don't have to: |
246 | | - |
247 | | -* Lorem ipsum dolor sit amet, consectetuer adipiscing elit. |
248 | | -Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, |
249 | | -viverra nec, fringilla in, laoreet vitae, risus. |
250 | | -* Donec sit amet nisl. Aliquam semper ipsum sit amet velit. |
251 | | -Suspendisse id sem consectetuer libero luctus adipiscing. |
252 | | - |
253 | | -List items may consist of multiple paragraphs. Each subsequent |
254 | | -paragraph in a list item must be indented by either 4 spaces |
255 | | -or one tab: |
256 | | - |
257 | | -1. This is a list item with two paragraphs. Lorem ipsum dolor |
258 | | - sit amet, consectetuer adipiscing elit. Aliquam hendrerit |
259 | | - mi posuere lectus. |
260 | | - |
261 | | - Vestibulum enim wisi, viverra nec, fringilla in, laoreet |
262 | | - vitae, risus. Donec sit amet nisl. Aliquam semper ipsum |
263 | | - sit amet velit. |
264 | | - |
265 | | -2. Suspendisse id sem consectetuer libero luctus adipiscing. |
266 | | - |
267 | | -It looks nice if you indent every line of the subsequent |
268 | | -paragraphs, but here again, Markdown will allow you to be |
269 | | -lazy: |
270 | | - |
271 | | -* This is a list item with two paragraphs. |
272 | | - |
273 | | - This is the second paragraph in the list item. You're |
274 | | -only required to indent the first line. Lorem ipsum dolor |
275 | | -sit amet, consectetuer adipiscing elit. |
276 | | - |
277 | | -* Another item in the same list. |
278 | | - |
279 | | -To put a blockquote within a list item, the blockquote's `>` |
280 | | -delimiters need to be indented: |
281 | | - |
282 | | -* A list item with a blockquote: |
283 | | - |
284 | | - > This is a blockquote |
285 | | - > inside a list item. |
286 | | -
|
287 | | -To put a code block within a list item, the code block needs |
288 | | -to be indented *twice* -- 8 spaces or two tabs: |
289 | | - |
290 | | -* A list item with a code block: |
291 | | - |
292 | | - <code goes here> |
293 | | - |
294 | | -### Code Blocks |
295 | | - |
296 | | -Pre-formatted code blocks are used for writing about programming or |
297 | | -markup source code. Rather than forming normal paragraphs, the lines |
298 | | -of a code block are interpreted literally. Markdown wraps a code block |
299 | | -in both `<pre>` and `<code>` tags. |
300 | | - |
301 | | -To produce a code block in Markdown, simply indent every line of the |
302 | | -block by at least 4 spaces or 1 tab. |
303 | | - |
304 | | -This is a normal paragraph: |
305 | | - |
306 | | - This is a code block. |
307 | | - |
308 | | -Here is an example of AppleScript: |
309 | | - |
310 | | - tell application "Foo" |
311 | | - beep |
312 | | - end tell |
313 | | - |
314 | | -A code block continues until it reaches a line that is not indented |
315 | | -(or the end of the article). |
316 | | - |
317 | | -Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) |
318 | | -are automatically converted into HTML entities. This makes it very |
319 | | -easy to include example HTML source code using Markdown -- just paste |
320 | | -it and indent it, and Markdown will handle the hassle of encoding the |
321 | | -ampersands and angle brackets. For example, this: |
322 | | - |
323 | | - <div class="footer"> |
324 | | - © 2004 Foo Corporation |
325 | | - </div> |
326 | | - |
327 | | -Regular Markdown syntax is not processed within code blocks. E.g., |
328 | | -asterisks are just literal asterisks within a code block. This means |
329 | | -it's also easy to use Markdown to write about Markdown's own syntax. |
330 | | - |
331 | | -``` |
332 | | -tell application "Foo" |
333 | | - beep |
334 | | -end tell |
335 | | -``` |
336 | | - |
337 | | -## Span Elements |
338 | | - |
339 | | -### Links |
340 | | - |
341 | | -Markdown supports two style of links: *inline* and *reference*. |
342 | | - |
343 | | -In both styles, the link text is delimited by [square brackets]. |
344 | | - |
345 | | -To create an inline link, use a set of regular parentheses immediately |
346 | | -after the link text's closing square bracket. Inside the parentheses, |
347 | | -put the URL where you want the link to point, along with an *optional* |
348 | | -title for the link, surrounded in quotes. For example: |
349 | | - |
350 | | -This is [an example](http://example.com/) inline link. |
351 | | - |
352 | | -[This link](http://example.net/) has no title attribute. |
353 | | - |
354 | | -### Emphasis |
355 | | - |
356 | | -Markdown treats asterisks (`*`) and underscores (`_`) as indicators of |
357 | | -emphasis. Text wrapped with one `*` or `_` will be wrapped with an |
358 | | -HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML |
359 | | -`<strong>` tag. E.g., this input: |
360 | | - |
361 | | -*single asterisks* |
362 | | - |
363 | | -_single underscores_ |
364 | | - |
365 | | -**double asterisks** |
366 | | - |
367 | | -__double underscores__ |
368 | | - |
369 | | -### Code |
370 | | - |
371 | | -To indicate a span of code, wrap it with backtick quotes (`` ` ``). |
372 | | -Unlike a pre-formatted code block, a code span indicates code within a |
373 | | -normal paragraph. For example: |
| 76 | +### Evolved table (mixed inline formatting) |
374 | 77 |
|
375 | | -Use the `printf()` function. |
| 78 | +Each cell is an independent inline scope: inline markers (`~`, `**`, `` ` ``, |
| 79 | +`~~`, ...) must NOT span across cells/rows. |
376 | 80 |
|
| 81 | +| Header **A** | Header *B* | Col `C` | |
| 82 | +| :----------- | :--------: | ------: | |
| 83 | +| **strong** | *italic* | `code()` | |
| 84 | +| ~~strike~~ | [link](http://x.it) | a~b~c | |
| 85 | +| H~2~O | x^2^ | plain text | |
| 86 | +| pipe \| escaped | normal | end | |
| 87 | +| **Totale LDV/anno** | **~7.000 – 8.000** | ~30-35 LDV/giorno | |
0 commit comments