react-intlayer 7.5.14 → 8.0.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/assets/markdown/_fixture.md +896 -0
  2. package/dist/cjs/client/IntlayerProvider.cjs +30 -3
  3. package/dist/cjs/client/IntlayerProvider.cjs.map +1 -1
  4. package/dist/cjs/client/format/index.cjs +2 -0
  5. package/dist/cjs/client/format/useIntl.cjs +45 -0
  6. package/dist/cjs/client/format/useIntl.cjs.map +1 -0
  7. package/dist/cjs/client/t.cjs +21 -2
  8. package/dist/cjs/client/t.cjs.map +1 -1
  9. package/dist/cjs/client/useIntlayer.cjs +16 -3
  10. package/dist/cjs/client/useIntlayer.cjs.map +1 -1
  11. package/dist/cjs/client/useLocale.cjs +21 -1
  12. package/dist/cjs/client/useLocale.cjs.map +1 -1
  13. package/dist/cjs/getDictionary.cjs +1 -0
  14. package/dist/cjs/getDictionary.cjs.map +1 -1
  15. package/dist/cjs/getIntlayer.cjs +1 -0
  16. package/dist/cjs/getIntlayer.cjs.map +1 -1
  17. package/dist/cjs/html/HTMLProvider.cjs +18 -0
  18. package/dist/cjs/html/HTMLProvider.cjs.map +1 -0
  19. package/dist/cjs/html/HTMLRendererPlugin.cjs +42 -0
  20. package/dist/cjs/html/HTMLRendererPlugin.cjs.map +1 -0
  21. package/dist/cjs/html/index.cjs +7 -0
  22. package/dist/cjs/index.cjs +6 -0
  23. package/dist/cjs/markdown/MarkdownProvider.cjs +37 -5
  24. package/dist/cjs/markdown/MarkdownProvider.cjs.map +1 -1
  25. package/dist/cjs/markdown/MarkdownRenderer.cjs +24 -34
  26. package/dist/cjs/markdown/MarkdownRenderer.cjs.map +1 -1
  27. package/dist/cjs/markdown/MarkdownRendererPlugin.cjs +33 -0
  28. package/dist/cjs/markdown/MarkdownRendererPlugin.cjs.map +1 -0
  29. package/dist/cjs/markdown/index.cjs +16 -1
  30. package/dist/cjs/markdown/processor.cjs +66 -0
  31. package/dist/cjs/markdown/processor.cjs.map +1 -0
  32. package/dist/cjs/markdown/runtime.cjs +45 -0
  33. package/dist/cjs/markdown/runtime.cjs.map +1 -0
  34. package/dist/cjs/plugins.cjs +36 -5
  35. package/dist/cjs/plugins.cjs.map +1 -1
  36. package/dist/cjs/server/format/useIntl.cjs +44 -0
  37. package/dist/cjs/server/format/useIntl.cjs.map +1 -0
  38. package/dist/cjs/server/index.cjs +2 -0
  39. package/dist/esm/IntlayerNode.mjs +2 -2
  40. package/dist/esm/IntlayerNode.mjs.map +1 -1
  41. package/dist/esm/client/IntlayerProvider.mjs +30 -3
  42. package/dist/esm/client/IntlayerProvider.mjs.map +1 -1
  43. package/dist/esm/client/format/index.mjs +2 -1
  44. package/dist/esm/client/format/useIntl.mjs +44 -0
  45. package/dist/esm/client/format/useIntl.mjs.map +1 -0
  46. package/dist/esm/client/t.mjs +21 -2
  47. package/dist/esm/client/t.mjs.map +1 -1
  48. package/dist/esm/client/useIntlayer.mjs +16 -3
  49. package/dist/esm/client/useIntlayer.mjs.map +1 -1
  50. package/dist/esm/client/useLocale.mjs +21 -1
  51. package/dist/esm/client/useLocale.mjs.map +1 -1
  52. package/dist/esm/editor/IntlayerEditorProvider.mjs +3 -3
  53. package/dist/esm/editor/IntlayerEditorProvider.mjs.map +1 -1
  54. package/dist/esm/getDictionary.mjs +2 -1
  55. package/dist/esm/getDictionary.mjs.map +1 -1
  56. package/dist/esm/getIntlayer.mjs +2 -1
  57. package/dist/esm/getIntlayer.mjs.map +1 -1
  58. package/dist/esm/html/HTMLProvider.mjs +16 -0
  59. package/dist/esm/html/HTMLProvider.mjs.map +1 -0
  60. package/dist/esm/html/HTMLRendererPlugin.mjs +40 -0
  61. package/dist/esm/html/HTMLRendererPlugin.mjs.map +1 -0
  62. package/dist/esm/html/index.mjs +4 -0
  63. package/dist/esm/index.mjs +4 -1
  64. package/dist/esm/markdown/MarkdownProvider.mjs +37 -5
  65. package/dist/esm/markdown/MarkdownProvider.mjs.map +1 -1
  66. package/dist/esm/markdown/MarkdownRenderer.mjs +25 -34
  67. package/dist/esm/markdown/MarkdownRenderer.mjs.map +1 -1
  68. package/dist/esm/markdown/MarkdownRendererPlugin.mjs +31 -0
  69. package/dist/esm/markdown/MarkdownRendererPlugin.mjs.map +1 -0
  70. package/dist/esm/markdown/index.mjs +5 -2
  71. package/dist/esm/markdown/processor.mjs +59 -0
  72. package/dist/esm/markdown/processor.mjs.map +1 -0
  73. package/dist/esm/markdown/runtime.mjs +41 -0
  74. package/dist/esm/markdown/runtime.mjs.map +1 -0
  75. package/dist/esm/plugins.mjs +35 -5
  76. package/dist/esm/plugins.mjs.map +1 -1
  77. package/dist/esm/server/format/useIntl.mjs +42 -0
  78. package/dist/esm/server/format/useIntl.mjs.map +1 -0
  79. package/dist/esm/server/index.mjs +2 -1
  80. package/dist/types/client/IntlayerProvider.d.ts +48 -3
  81. package/dist/types/client/IntlayerProvider.d.ts.map +1 -1
  82. package/dist/types/client/format/index.d.ts +2 -1
  83. package/dist/types/client/format/useCompact.d.ts +2 -2
  84. package/dist/types/client/format/useCurrency.d.ts +2 -2
  85. package/dist/types/client/format/useIntl.d.ts +93 -0
  86. package/dist/types/client/format/useIntl.d.ts.map +1 -0
  87. package/dist/types/client/format/useList.d.ts +2 -2
  88. package/dist/types/client/format/useNumber.d.ts +2 -2
  89. package/dist/types/client/format/useNumber.d.ts.map +1 -1
  90. package/dist/types/client/format/usePercentage.d.ts +2 -2
  91. package/dist/types/client/format/usePercentage.d.ts.map +1 -1
  92. package/dist/types/client/format/useRelativeTime.d.ts +2 -2
  93. package/dist/types/client/format/useRelativeTime.d.ts.map +1 -1
  94. package/dist/types/client/format/useUnit.d.ts +2 -2
  95. package/dist/types/client/t.d.ts +21 -2
  96. package/dist/types/client/t.d.ts.map +1 -1
  97. package/dist/types/client/useDictionary.d.ts +2 -2
  98. package/dist/types/client/useDictionaryDynamic.d.ts +2 -2
  99. package/dist/types/client/useIntlayer.d.ts +18 -5
  100. package/dist/types/client/useIntlayer.d.ts.map +1 -1
  101. package/dist/types/client/useLocale.d.ts +21 -1
  102. package/dist/types/client/useLocale.d.ts.map +1 -1
  103. package/dist/types/client/useLocaleBase.d.ts +5 -5
  104. package/dist/types/client/useLocaleStorage.d.ts +5 -5
  105. package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
  106. package/dist/types/getDictionary.d.ts.map +1 -1
  107. package/dist/types/getIntlayer.d.ts.map +1 -1
  108. package/dist/types/html/HTMLProvider.d.ts +17 -0
  109. package/dist/types/html/HTMLProvider.d.ts.map +1 -0
  110. package/dist/types/html/HTMLRendererPlugin.d.ts +20 -0
  111. package/dist/types/html/HTMLRendererPlugin.d.ts.map +1 -0
  112. package/dist/types/html/index.d.ts +3 -0
  113. package/dist/types/index.d.ts +6 -2
  114. package/dist/types/index.d.ts.map +1 -1
  115. package/dist/types/markdown/MarkdownProvider.d.ts +44 -3
  116. package/dist/types/markdown/MarkdownProvider.d.ts.map +1 -1
  117. package/dist/types/markdown/MarkdownRenderer.d.ts +27 -9
  118. package/dist/types/markdown/MarkdownRenderer.d.ts.map +1 -1
  119. package/dist/types/markdown/MarkdownRendererPlugin.d.ts +19 -0
  120. package/dist/types/markdown/MarkdownRendererPlugin.d.ts.map +1 -0
  121. package/dist/types/markdown/index.d.ts +6 -3
  122. package/dist/types/markdown/processor.d.ts +93 -0
  123. package/dist/types/markdown/processor.d.ts.map +1 -0
  124. package/dist/types/markdown/runtime.d.ts +20 -0
  125. package/dist/types/markdown/runtime.d.ts.map +1 -0
  126. package/dist/types/plugins.d.ts +20 -11
  127. package/dist/types/plugins.d.ts.map +1 -1
  128. package/dist/types/server/format/useIntl.d.ts +93 -0
  129. package/dist/types/server/format/useIntl.d.ts.map +1 -0
  130. package/dist/types/server/index.d.ts +2 -1
  131. package/dist/types/server/useDictionary.d.ts +2 -2
  132. package/dist/types/server/useDictionaryAsync.d.ts +2 -2
  133. package/dist/types/server/useDictionaryDynamic.d.ts +2 -2
  134. package/dist/types/server/useIntlayer.d.ts +3 -3
  135. package/dist/types/server/useIntlayer.d.ts.map +1 -1
  136. package/package.json +20 -10
@@ -0,0 +1,896 @@
1
+ ---
2
+ draft: false
3
+ date: 2024-01-15
4
+ ---
5
+
6
+ # Markdown: Syntax
7
+
8
+ <ul id="ProjectSubmenu">
9
+ <li>
10
+ <a href="/projects/markdown/" title="Markdown Project Page">
11
+ Main
12
+ </a>
13
+ </li>
14
+ <li>
15
+ <a href="/projects/markdown/basics" title="Markdown Basics">
16
+ Basics
17
+ </a>
18
+ </li>
19
+ <li>
20
+ <a class="selected" title="Markdown Syntax Documentation">
21
+ Syntax
22
+ </a>
23
+ </li>
24
+ <li>
25
+ <a
26
+ href="/projects/markdown/license"
27
+ title="Pricing and License Information"
28
+ >
29
+ License
30
+ </a>
31
+ </li>
32
+ <li>
33
+ <a href="/projects/markdown/dingus" title="Online Markdown Web Form">
34
+ Dingus
35
+ </a>
36
+ </li>
37
+ </ul>
38
+
39
+ - [Overview](#overview)
40
+ - [Philosophy](#philosophy)
41
+ - [Inline HTML](#html)
42
+ - [Automatic Escaping for Special Characters](#autoescape)
43
+ - [Block Elements](#block)
44
+ - [Paragraphs and Line Breaks](#p)
45
+ - [Headers](#header)
46
+ - [Blockquotes](#blockquote)
47
+ - [Lists](#list)
48
+ - [Code Blocks](#precode)
49
+ - [Horizontal Rules](#hr)
50
+ - [Span Elements](#span)
51
+ - [Links](#link)
52
+ - [Emphasis](#em)
53
+ - [Code](#code)
54
+ - [Images](#img)
55
+ - [Miscellaneous](#misc)
56
+ - [Backslash Escapes](#backslash)
57
+ - [Automatic Links](#autolink)
58
+
59
+ **Note:** This document is itself written using Markdown; you
60
+ can [see the source for it by adding '.text' to the URL][src].
61
+
62
+ [src]: /projects/markdown/syntax.text
63
+
64
+ ---
65
+
66
+ <h2 id="overview">Overview</h2>
67
+
68
+ <h3 id="philosophy">Philosophy</h3>
69
+
70
+ Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
71
+
72
+ Readability, however, is emphasized above all else. A Markdown-formatted
73
+ document should be publishable as-is, as plain text, without looking
74
+ like it's been marked up with tags or formatting instructions. While
75
+ Markdown's syntax has been influenced by several existing text-to-HTML
76
+ filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4],
77
+ [Grutatext] [5], and [EtText] [6] -- the single biggest source of
78
+ inspiration for Markdown's syntax is the format of plain text email.
79
+
80
+ [1]: http://docutils.sourceforge.net/mirror/setext.html
81
+ [2]: http://www.aaronsw.com/2002/atx/
82
+ [3]: http://textism.com/tools/textile/
83
+ [4]: http://docutils.sourceforge.net/rst.html
84
+ [5]: http://www.triptico.com/software/grutatxt.html
85
+ [6]: http://ettext.taint.org/doc/
86
+
87
+ To this end, Markdown's syntax is comprised entirely of punctuation
88
+ characters, which punctuation characters have been carefully chosen so
89
+ as to look like what they mean. E.g., asterisks around a word actually
90
+ look like \*emphasis\*. Markdown lists look like, well, lists. Even
91
+ blockquotes look like quoted passages of text, assuming you've ever
92
+ used email.
93
+
94
+ <h3 id="html">Inline HTML</h3>
95
+
96
+ Markdown's syntax is intended for one purpose: to be used as a
97
+ format for _writing_ for the web.
98
+
99
+ Markdown is not a replacement for HTML, or even close to it. Its
100
+ syntax is very small, corresponding only to a very small subset of
101
+ HTML tags. The idea is _not_ to create a syntax that makes it easier
102
+ to insert HTML tags. In my opinion, HTML tags are already easy to
103
+ insert. The idea for Markdown is to make it easy to read, write, and
104
+ edit prose. HTML is a _publishing_ format; Markdown is a _writing_
105
+ format. Thus, Markdown's formatting syntax only addresses issues that
106
+ can be conveyed in plain text.
107
+
108
+ For any markup that is not covered by Markdown's syntax, you simply
109
+ use HTML itself. There's no need to preface it or delimit it to
110
+ indicate that you're switching from Markdown to HTML; you just use
111
+ the tags.
112
+
113
+ The only restrictions are that block-level HTML elements -- e.g. `<div>`,
114
+ `<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding
115
+ content by blank lines, and the start and end tags of the block should
116
+ not be indented with tabs or spaces. Markdown is smart enough not
117
+ to add extra (unwanted) `<p>` tags around HTML block-level tags.
118
+
119
+ For example, to add an HTML table to a Markdown article:
120
+
121
+ This is a regular paragraph.
122
+
123
+ <table>
124
+ <tr>
125
+ <td>Foo</td>
126
+ </tr>
127
+ </table>
128
+
129
+ This is another regular paragraph.
130
+
131
+ Note that Markdown formatting syntax is not processed within block-level
132
+ HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an
133
+ HTML block.
134
+
135
+ Span-level HTML tags -- e.g. `<span>`, `<cite>`, or `<del>` -- can be
136
+ used anywhere in a Markdown paragraph, list item, or header. If you
137
+ want, you can even use HTML tags instead of Markdown formatting; e.g. if
138
+ you'd prefer to use HTML `<a>` or `<img>` tags instead of Markdown's
139
+ link or image syntax, go right ahead.
140
+
141
+ Unlike block-level HTML tags, Markdown syntax _is_ processed within
142
+ span-level tags.
143
+
144
+ <h3 id="autoescape">Automatic Escaping for Special Characters</h3>
145
+
146
+ In HTML, there are two characters that demand special treatment: `<`
147
+ and `&`. Left angle brackets are used to start tags; ampersands are
148
+ used to denote HTML entities. If you want to use them as literal
149
+ characters, you must escape them as entities, e.g. `&lt;`, and
150
+ `&amp;`.
151
+
152
+ Ampersands in particular are bedeviling for web writers. If you want to
153
+ write about 'AT&T', you need to write '`AT&amp;T`'. You even need to
154
+ escape ampersands within URLs. Thus, if you want to link to:
155
+
156
+ http://images.google.com/images?num=30&q=larry+bird
157
+
158
+ you need to encode the URL as:
159
+
160
+ http://images.google.com/images?num=30&amp;q=larry+bird
161
+
162
+ in your anchor tag `href` attribute. Needless to say, this is easy to
163
+ forget, and is probably the single most common source of HTML validation
164
+ errors in otherwise well-marked-up web sites.
165
+
166
+ Markdown allows you to use these characters naturally, taking care of
167
+ all the necessary escaping for you. If you use an ampersand as part of
168
+ an HTML entity, it remains unchanged; otherwise it will be translated
169
+ into `&amp;`.
170
+
171
+ So, if you want to include a copyright symbol in your article, you can write:
172
+
173
+ &copy;
174
+
175
+ and Markdown will leave it alone. But if you write:
176
+
177
+ AT&T
178
+
179
+ Markdown will translate it to:
180
+
181
+ AT&amp;T
182
+
183
+ Similarly, because Markdown supports [inline HTML](#html), if you use
184
+ angle brackets as delimiters for HTML tags, Markdown will treat them as
185
+ such. But if you write:
186
+
187
+ 4 < 5
188
+
189
+ Markdown will translate it to:
190
+
191
+ 4 &lt; 5
192
+
193
+ However, inside Markdown code spans and blocks, angle brackets and
194
+ ampersands are _always_ encoded automatically. This makes it easy to use
195
+ Markdown to write about HTML code. (As opposed to raw HTML, which is a
196
+ terrible format for writing about HTML syntax, because every single `<`
197
+ and `&` in your example code needs to be escaped.)
198
+
199
+ ---
200
+
201
+ <h2 id="block">Block Elements</h2>
202
+
203
+ <h3 id="p">Paragraphs and Line Breaks</h3>
204
+
205
+ A paragraph is simply one or more consecutive lines of text, separated
206
+ by one or more blank lines. (A blank line is any line that looks like a
207
+ blank line -- a line containing nothing but spaces or tabs is considered
208
+ blank.) Normal paragraphs should not be indented with spaces or tabs.
209
+
210
+ The implication of the "one or more consecutive lines of text" rule is
211
+ that Markdown supports "hard-wrapped" text paragraphs. This differs
212
+ significantly from most other text-to-HTML formatters (including Movable
213
+ Type's "Convert Line Breaks" option) which translate every line break
214
+ character in a paragraph into a `<br />` tag.
215
+
216
+ When you _do_ want to insert a `<br />` break tag using Markdown, you
217
+ end a line with two or more spaces, then type return.
218
+
219
+ Yes, this takes a tad more effort to create a `<br />`, but a simplistic
220
+ "every line break is a `<br />`" rule wouldn't work for Markdown.
221
+ Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l]
222
+ work best -- and look better -- when you format them with hard breaks.
223
+
224
+ [bq]: #blockquote
225
+ [l]: #list
226
+
227
+ <h3 id="header">Headers</h3>
228
+
229
+ Markdown supports two styles of headers, [Setext] [1] and [atx] [2].
230
+
231
+ Setext-style headers are "underlined" using equal signs (for first-level
232
+ headers) and dashes (for second-level headers). For example:
233
+
234
+ This is an H1
235
+ =============
236
+
237
+ This is an H2
238
+ -------------
239
+
240
+ Any number of underlining `=`'s or `-`'s will work.
241
+
242
+ Atx-style headers use 1-6 hash characters at the start of the line,
243
+ corresponding to header levels 1-6. For example:
244
+
245
+ # This is an H1
246
+
247
+ ## This is an H2
248
+
249
+ ###### This is an H6
250
+
251
+ Optionally, you may "close" atx-style headers. This is purely
252
+ cosmetic -- you can use this if you think it looks better. The
253
+ closing hashes don't even need to match the number of hashes
254
+ used to open the header. (The number of opening hashes
255
+ determines the header level.) :
256
+
257
+ # This is an H1 #
258
+
259
+ ## This is an H2 ##
260
+
261
+ ### This is an H3 ######
262
+
263
+ <h3 id="blockquote">Blockquotes</h3>
264
+
265
+ Markdown uses email-style `>` characters for blockquoting. If you're
266
+ familiar with quoting passages of text in an email message, then you
267
+ know how to create a blockquote in Markdown. It looks best if you hard
268
+ wrap the text and put a `>` before every line:
269
+
270
+ > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
271
+ > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
272
+ > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
273
+ >
274
+ > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
275
+ > id sem consectetuer libero luctus adipiscing.
276
+
277
+ Markdown allows you to be lazy and only put the `>` before the first
278
+ line of a hard-wrapped paragraph:
279
+
280
+ > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
281
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
282
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
283
+
284
+ > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
285
+ id sem consectetuer libero luctus adipiscing.
286
+
287
+ Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
288
+ adding additional levels of `>`:
289
+
290
+ > This is the first level of quoting.
291
+ >
292
+ > > This is nested blockquote.
293
+ >
294
+ > Back to the first level.
295
+
296
+ Blockquotes can contain other Markdown elements, including headers, lists,
297
+ and code blocks:
298
+
299
+ > ## This is a header.
300
+ >
301
+ > 1. This is the first list item.
302
+ > 2. This is the second list item.
303
+ >
304
+ > Here's some example code:
305
+ >
306
+ > return shell_exec("echo $input | $markdown_script");
307
+
308
+ Any decent text editor should make email-style quoting easy. For
309
+ example, with BBEdit, you can make a selection and choose Increase
310
+ Quote Level from the Text menu.
311
+
312
+ <h3 id="list">Lists</h3>
313
+
314
+ Markdown supports ordered (numbered) and unordered (bulleted) lists.
315
+
316
+ Unordered lists use asterisks, pluses, and hyphens -- interchangably
317
+ -- as list markers:
318
+
319
+ * Red
320
+ * Green
321
+ * Blue
322
+
323
+ is equivalent to:
324
+
325
+ + Red
326
+ + Green
327
+ + Blue
328
+
329
+ and:
330
+
331
+ - Red
332
+ - Green
333
+ - Blue
334
+
335
+ Ordered lists use numbers followed by periods:
336
+
337
+ 1. Bird
338
+ 2. McHale
339
+ 3. Parish
340
+
341
+ It's important to note that the actual numbers you use to mark the
342
+ list have no effect on the HTML output Markdown produces. The HTML
343
+ Markdown produces from the above list is:
344
+
345
+ <ol>
346
+ <li>Bird</li>
347
+ <li>McHale</li>
348
+ <li>Parish</li>
349
+ </ol>
350
+
351
+ If you instead wrote the list in Markdown like this:
352
+
353
+ 1. Bird
354
+ 1. McHale
355
+ 1. Parish
356
+
357
+ or even:
358
+
359
+ 3. Bird
360
+ 1. McHale
361
+ 8. Parish
362
+
363
+ you'd get the exact same HTML output. The point is, if you want to,
364
+ you can use ordinal numbers in your ordered Markdown lists, so that
365
+ the numbers in your source match the numbers in your published HTML.
366
+ But if you want to be lazy, you don't have to.
367
+
368
+ If you do use lazy list numbering, however, you should still start the
369
+ list with the number 1. At some point in the future, Markdown may support
370
+ starting ordered lists at an arbitrary number.
371
+
372
+ List markers typically start at the left margin, but may be indented by
373
+ up to three spaces. List markers must be followed by one or more spaces
374
+ or a tab.
375
+
376
+ To make lists look nice, you can wrap items with hanging indents:
377
+
378
+ * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
379
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
380
+ viverra nec, fringilla in, laoreet vitae, risus.
381
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
382
+ Suspendisse id sem consectetuer libero luctus adipiscing.
383
+
384
+ But if you want to be lazy, you don't have to:
385
+
386
+ * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
387
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
388
+ viverra nec, fringilla in, laoreet vitae, risus.
389
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
390
+ Suspendisse id sem consectetuer libero luctus adipiscing.
391
+
392
+ If list items are separated by blank lines, Markdown will wrap the
393
+ items in `<p>` tags in the HTML output. For example, this input:
394
+
395
+ * Bird
396
+ * Magic
397
+
398
+ will turn into:
399
+
400
+ <ul>
401
+ <li>Bird</li>
402
+ <li>Magic</li>
403
+ </ul>
404
+
405
+ But this:
406
+
407
+ * Bird
408
+
409
+ * Magic
410
+
411
+ will turn into:
412
+
413
+ <ul>
414
+ <li><p>Bird</p></li>
415
+ <li><p>Magic</p></li>
416
+ </ul>
417
+
418
+ List items may consist of multiple paragraphs. Each subsequent
419
+ paragraph in a list item must be indented by either 4 spaces
420
+ or one tab:
421
+
422
+ 1. This is a list item with two paragraphs. Lorem ipsum dolor
423
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
424
+ mi posuere lectus.
425
+
426
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet
427
+ vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
428
+ sit amet velit.
429
+
430
+ 2. Suspendisse id sem consectetuer libero luctus adipiscing.
431
+
432
+ It looks nice if you indent every line of the subsequent
433
+ paragraphs, but here again, Markdown will allow you to be
434
+ lazy:
435
+
436
+ * This is a list item with two paragraphs.
437
+
438
+ This is the second paragraph in the list item. You're
439
+ only required to indent the first line. Lorem ipsum dolor
440
+ sit amet, consectetuer adipiscing elit.
441
+
442
+ * Another item in the same list.
443
+
444
+ To put a blockquote within a list item, the blockquote's `>`
445
+ delimiters need to be indented:
446
+
447
+ * A list item with a blockquote:
448
+
449
+ > This is a blockquote
450
+ > inside a list item.
451
+
452
+ To put a code block within a list item, the code block needs
453
+ to be indented _twice_ -- 8 spaces or two tabs:
454
+
455
+ * A list item with a code block:
456
+
457
+ <code goes here>
458
+
459
+ It's worth noting that it's possible to trigger an ordered list by
460
+ accident, by writing something like this:
461
+
462
+ 1986. What a great season.
463
+
464
+ In other words, a _number-period-space_ sequence at the beginning of a
465
+ line. To avoid this, you can backslash-escape the period:
466
+
467
+ 1986\. What a great season.
468
+
469
+ <h3 id="precode">Code Blocks</h3>
470
+
471
+ Pre-formatted code blocks are used for writing about programming or
472
+ markup source code. Rather than forming normal paragraphs, the lines
473
+ of a code block are interpreted literally. Markdown wraps a code block
474
+ in both `<pre>` and `<code>` tags.
475
+
476
+ To produce a code block in Markdown, simply indent every line of the
477
+ block by at least 4 spaces or 1 tab. For example, given this input:
478
+
479
+ This is a normal paragraph:
480
+
481
+ This is a code block.
482
+
483
+ Markdown will generate:
484
+
485
+ <p>This is a normal paragraph:</p>
486
+
487
+ <pre><code>This is a code block.
488
+ </code></pre>
489
+
490
+ One level of indentation -- 4 spaces or 1 tab -- is removed from each
491
+ line of the code block. For example, this:
492
+
493
+ Here is an example of AppleScript:
494
+
495
+ tell application "Foo"
496
+ beep
497
+ end tell
498
+
499
+ will turn into:
500
+
501
+ <p>Here is an example of AppleScript:</p>
502
+
503
+ <pre><code>tell application "Foo"
504
+ beep
505
+ end tell
506
+ </code></pre>
507
+
508
+ A code block continues until it reaches a line that is not indented
509
+ (or the end of the article).
510
+
511
+ Within a code block, ampersands (`&`) and angle brackets (`<` and `>`)
512
+ are automatically converted into HTML entities. This makes it very
513
+ easy to include example HTML source code using Markdown -- just paste
514
+ it and indent it, and Markdown will handle the hassle of encoding the
515
+ ampersands and angle brackets. For example, this:
516
+
517
+ <div class="footer">
518
+ &copy; 2004 Foo Corporation
519
+ </div>
520
+
521
+ will turn into:
522
+
523
+ <pre><code>&lt;div class="footer"&gt;
524
+ &amp;copy; 2004 Foo Corporation
525
+ &lt;/div&gt;
526
+ </code></pre>
527
+
528
+ Regular Markdown syntax is not processed within code blocks. E.g.,
529
+ asterisks are just literal asterisks within a code block. This means
530
+ it's also easy to use Markdown to write about Markdown's own syntax.
531
+
532
+ <h3 id="hr">Horizontal Rules</h3>
533
+
534
+ You can produce a horizontal rule tag (`<hr />`) by placing three or
535
+ more hyphens, asterisks, or underscores on a line by themselves. If you
536
+ wish, you may use spaces between the hyphens or asterisks. Each of the
537
+ following lines will produce a horizontal rule:
538
+
539
+ * * *
540
+
541
+ ***
542
+
543
+ *****
544
+
545
+ - - -
546
+
547
+ ---------------------------------------
548
+
549
+ ---
550
+
551
+ <h2 id="span">Span Elements</h2>
552
+
553
+ <h3 id="link">Links</h3>
554
+
555
+ Markdown supports two style of links: _inline_ and _reference_.
556
+
557
+ In both styles, the link text is delimited by [square brackets].
558
+
559
+ To create an inline link, use a set of regular parentheses immediately
560
+ after the link text's closing square bracket. Inside the parentheses,
561
+ put the URL where you want the link to point, along with an _optional_
562
+ title for the link, surrounded in quotes. For example:
563
+
564
+ This is [an example](http://example.com/ "Title") inline link.
565
+
566
+ [This link](http://example.net/) has no title attribute.
567
+
568
+ Will produce:
569
+
570
+ <p>This is <a href="http://example.com/" title="Title">
571
+ an example</a> inline link.</p>
572
+
573
+ <p><a href="http://example.net/">This link</a> has no
574
+ title attribute.</p>
575
+
576
+ If you're referring to a local resource on the same server, you can
577
+ use relative paths:
578
+
579
+ See my [About](/about/) page for details.
580
+
581
+ Reference-style links use a second set of square brackets, inside
582
+ which you place a label of your choosing to identify the link:
583
+
584
+ This is [an example][id] reference-style link.
585
+
586
+ You can optionally use a space to separate the sets of brackets:
587
+
588
+ This is [an example] [id] reference-style link.
589
+
590
+ Then, anywhere in the document, you define your link label like this,
591
+ on a line by itself:
592
+
593
+ [id]: http://example.com/ "Optional Title Here"
594
+
595
+ That is:
596
+
597
+ - Square brackets containing the link identifier (optionally
598
+ indented from the left margin using up to three spaces);
599
+ - followed by a colon;
600
+ - followed by one or more spaces (or tabs);
601
+ - followed by the URL for the link;
602
+ - optionally followed by a title attribute for the link, enclosed
603
+ in double or single quotes, or enclosed in parentheses.
604
+
605
+ The following three link definitions are equivalent:
606
+
607
+ [foo]: http://example.com/ "Optional Title Here"
608
+ [foo]: http://example.com/ 'Optional Title Here'
609
+ [foo]: http://example.com/ (Optional Title Here)
610
+
611
+ **Note:** There is a known bug in Markdown.pl 1.0.1 which prevents
612
+ single quotes from being used to delimit link titles.
613
+
614
+ The link URL may, optionally, be surrounded by angle brackets:
615
+
616
+ [id]: <http://example.com/> "Optional Title Here"
617
+
618
+ You can put the title attribute on the next line and use extra spaces
619
+ or tabs for padding, which tends to look better with longer URLs:
620
+
621
+ [id]: http://example.com/longish/path/to/resource/here
622
+ "Optional Title Here"
623
+
624
+ Link definitions are only used for creating links during Markdown
625
+ processing, and are stripped from your document in the HTML output.
626
+
627
+ Link definition names may consist of letters, numbers, spaces, and
628
+ punctuation -- but they are _not_ case sensitive. E.g. these two
629
+ links:
630
+
631
+ [link text][a]
632
+ [link text][A]
633
+
634
+ are equivalent.
635
+
636
+ The _implicit link name_ shortcut allows you to omit the name of the
637
+ link, in which case the link text itself is used as the name.
638
+ Just use an empty set of square brackets -- e.g., to link the word
639
+ "Google" to the google.com web site, you could simply write:
640
+
641
+ [Google][]
642
+
643
+ And then define the link:
644
+
645
+ [Google]: http://google.com/
646
+
647
+ Because link names may contain spaces, this shortcut even works for
648
+ multiple words in the link text:
649
+
650
+ Visit [Daring Fireball][] for more information.
651
+
652
+ And then define the link:
653
+
654
+ [Daring Fireball]: http://daringfireball.net/
655
+
656
+ Link definitions can be placed anywhere in your Markdown document. I
657
+ tend to put them immediately after each paragraph in which they're
658
+ used, but if you want, you can put them all at the end of your
659
+ document, sort of like footnotes.
660
+
661
+ Here's an example of reference links in action:
662
+
663
+ I get 10 times more traffic from [Google] [1] than from
664
+ [Yahoo] [2] or [MSN] [3].
665
+
666
+ [1]: http://google.com/ "Google"
667
+ [2]: http://search.yahoo.com/ "Yahoo Search"
668
+ [3]: http://search.msn.com/ "MSN Search"
669
+
670
+ Using the implicit link name shortcut, you could instead write:
671
+
672
+ I get 10 times more traffic from [Google][] than from
673
+ [Yahoo][] or [MSN][].
674
+
675
+ [google]: http://google.com/ "Google"
676
+ [yahoo]: http://search.yahoo.com/ "Yahoo Search"
677
+ [msn]: http://search.msn.com/ "MSN Search"
678
+
679
+ Both of the above examples will produce the following HTML output:
680
+
681
+ <p>I get 10 times more traffic from <a href="http://google.com/"
682
+ title="Google">Google</a> than from
683
+ <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
684
+ or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
685
+
686
+ For comparison, here is the same paragraph written using
687
+ Markdown's inline link style:
688
+
689
+ I get 10 times more traffic from [Google](http://google.com/ "Google")
690
+ than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
691
+ [MSN](http://search.msn.com/ "MSN Search").
692
+
693
+ The point of reference-style links is not that they're easier to
694
+ write. The point is that with reference-style links, your document
695
+ source is vastly more readable. Compare the above examples: using
696
+ reference-style links, the paragraph itself is only 81 characters
697
+ long; with inline-style links, it's 176 characters; and as raw HTML,
698
+ it's 234 characters. In the raw HTML, there's more markup than there
699
+ is text.
700
+
701
+ With Markdown's reference-style links, a source document much more
702
+ closely resembles the final output, as rendered in a browser. By
703
+ allowing you to move the markup-related metadata out of the paragraph,
704
+ you can add links without interrupting the narrative flow of your
705
+ prose.
706
+
707
+ <h3 id="em">Emphasis</h3>
708
+
709
+ Markdown treats asterisks (`*`) and underscores (`_`) as indicators of
710
+ emphasis. Text wrapped with one `*` or `_` will be wrapped with an
711
+ HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML
712
+ `<strong>` tag. E.g., this input:
713
+
714
+ *single asterisks*
715
+
716
+ _single underscores_
717
+
718
+ **double asterisks**
719
+
720
+ __double underscores__
721
+
722
+ will produce:
723
+
724
+ <em>single asterisks</em>
725
+
726
+ <em>single underscores</em>
727
+
728
+ <strong>double asterisks</strong>
729
+
730
+ <strong>double underscores</strong>
731
+
732
+ You can use whichever style you prefer; the lone restriction is that
733
+ the same character must be used to open and close an emphasis span.
734
+
735
+ Emphasis can be used in the middle of a word:
736
+
737
+ un*frigging*believable
738
+
739
+ But if you surround an `*` or `_` with spaces, it'll be treated as a
740
+ literal asterisk or underscore.
741
+
742
+ To produce a literal asterisk or underscore at a position where it
743
+ would otherwise be used as an emphasis delimiter, you can backslash
744
+ escape it:
745
+
746
+ \*this text is surrounded by literal asterisks\*
747
+
748
+ <h3 id="code">Code</h3>
749
+
750
+ To indicate a span of code, wrap it with backtick quotes (`\``).
751
+ Unlike a pre-formatted code block, a code span indicates code within a
752
+ normal paragraph. For example:
753
+
754
+ Use the `printf()` function.
755
+
756
+ will produce:
757
+
758
+ <p>Use the <code>printf()</code> function.</p>
759
+
760
+ To include a literal backtick character within a code span, you can use
761
+ multiple backticks as the opening and closing delimiters:
762
+
763
+ ``There is a literal backtick (`) here.``
764
+
765
+ which will produce this:
766
+
767
+ <p><code>There is a literal backtick (`) here.</code></p>
768
+
769
+ The backtick delimiters surrounding a code span may include spaces --
770
+ one after the opening, one before the closing. This allows you to place
771
+ literal backtick characters at the beginning or end of a code span:
772
+
773
+ A single backtick in a code span: `` ` ``
774
+
775
+ A backtick-delimited string in a code span: `` `foo` ``
776
+
777
+ will produce:
778
+
779
+ <p>A single backtick in a code span: <code>`</code></p>
780
+
781
+ <p>A backtick-delimited string in a code span: <code>`foo`</code></p>
782
+
783
+ With a code span, ampersands and angle brackets are encoded as HTML
784
+ entities automatically, which makes it easy to include example HTML
785
+ tags. Markdown will turn this:
786
+
787
+ Please don't use any `<blink>` tags.
788
+
789
+ into:
790
+
791
+ <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
792
+
793
+ You can write this:
794
+
795
+ `&#8212;` is the decimal-encoded equivalent of `&mdash;`.
796
+
797
+ to produce:
798
+
799
+ <p><code>&amp;#8212;</code> is the decimal-encoded
800
+ equivalent of <code>&amp;mdash;</code>.</p>
801
+
802
+ <h3 id="img">Images</h3>
803
+
804
+ Admittedly, it's fairly difficult to devise a "natural" syntax for
805
+ placing images into a plain text document format.
806
+
807
+ Markdown uses an image syntax that is intended to resemble the syntax
808
+ for links, allowing for two styles: _inline_ and _reference_.
809
+
810
+ Inline image syntax looks like this:
811
+
812
+ ![Alt text](/path/to/img.jpg)
813
+
814
+ ![Alt text](/path/to/img.jpg "Optional title")
815
+
816
+ That is:
817
+
818
+ - An exclamation mark: `!`;
819
+ - followed by a set of square brackets, containing the `alt`
820
+ attribute text for the image;
821
+ - followed by a set of parentheses, containing the URL or path to
822
+ the image, and an optional `title` attribute enclosed in double
823
+ or single quotes.
824
+
825
+ Reference-style image syntax looks like this:
826
+
827
+ ![Alt text][id]
828
+
829
+ Where "id" is the name of a defined image reference. Image references
830
+ are defined using syntax identical to link references:
831
+
832
+ [id]: url/to/image "Optional title attribute"
833
+
834
+ As of this writing, Markdown has no syntax for specifying the
835
+ dimensions of an image; if this is important to you, you can simply
836
+ use regular HTML `<img>` tags.
837
+
838
+ ---
839
+
840
+ <h2 id="misc">Miscellaneous</h2>
841
+
842
+ <h3 id="autolink">Automatic Links</h3>
843
+
844
+ Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:
845
+
846
+ <http://example.com/>
847
+
848
+ Markdown will turn this into:
849
+
850
+ <a href="http://example.com/">http://example.com/</a>
851
+
852
+ Automatic links for email addresses work similarly, except that
853
+ Markdown will also perform a bit of randomized decimal and hex
854
+ entity-encoding to help obscure your address from address-harvesting
855
+ spambots. For example, Markdown will turn this:
856
+
857
+ <address@example.com>
858
+
859
+ into something like this:
860
+
861
+ <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
862
+ &#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
863
+ &#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
864
+ &#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
865
+
866
+ which will render in a browser as a clickable link to "address@example.com".
867
+
868
+ (This sort of entity-encoding trick will indeed fool many, if not
869
+ most, address-harvesting bots, but it definitely won't fool all of
870
+ them. It's better than nothing, but an address published in this way
871
+ will probably eventually start receiving spam.)
872
+
873
+ <h3 id="backslash">Backslash Escapes</h3>
874
+
875
+ Markdown allows you to use backslash escapes to generate literal
876
+ characters which would otherwise have special meaning in Markdown's
877
+ formatting syntax. For example, if you wanted to surround a word
878
+ with literal asterisks (instead of an HTML `<em>` tag), you can use
879
+ backslashes before the asterisks, like this:
880
+
881
+ \*literal asterisks\*
882
+
883
+ Markdown provides backslash escapes for the following characters:
884
+
885
+ \ backslash
886
+ ` backtick
887
+ * asterisk
888
+ _ underscore
889
+ {} curly braces
890
+ [] square brackets
891
+ () parentheses
892
+ # hash mark
893
+ + plus sign
894
+ - minus sign (hyphen)
895
+ . dot
896
+ ! exclamation mark