A place to cache linked articles (think custom and personal wayback machine)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 26KB

1 vuosi sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang="fr">
  4. <!-- Has to be within the first 1024 bytes, hence before the `title` element
  5. See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset -->
  6. <meta charset="utf-8">
  7. <!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 -->
  8. <!-- The viewport meta is quite crowded and we are responsible for that.
  9. See: https://codepen.io/tigt/post/meta-viewport-for-2015 -->
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <!-- Required to make a valid HTML5 document. -->
  12. <title>Basics, Tips and Tricks on how to use Markdown (archive) — David Larlet</title>
  13. <meta name="description" content="Publication mise en cache pour en conserver une trace.">
  14. <!-- That good ol' feed, subscribe :). -->
  15. <link rel="alternate" type="application/atom+xml" title="Feed" href="/david/log/">
  16. <!-- Generated from https://realfavicongenerator.net/ such a mess. -->
  17. <link rel="apple-touch-icon" sizes="180x180" href="/static/david/icons2/apple-touch-icon.png">
  18. <link rel="icon" type="image/png" sizes="32x32" href="/static/david/icons2/favicon-32x32.png">
  19. <link rel="icon" type="image/png" sizes="16x16" href="/static/david/icons2/favicon-16x16.png">
  20. <link rel="manifest" href="/static/david/icons2/site.webmanifest">
  21. <link rel="mask-icon" href="/static/david/icons2/safari-pinned-tab.svg" color="#07486c">
  22. <link rel="shortcut icon" href="/static/david/icons2/favicon.ico">
  23. <meta name="msapplication-TileColor" content="#f7f7f7">
  24. <meta name="msapplication-config" content="/static/david/icons2/browserconfig.xml">
  25. <meta name="theme-color" content="#f7f7f7" media="(prefers-color-scheme: light)">
  26. <meta name="theme-color" content="#272727" media="(prefers-color-scheme: dark)">
  27. <!-- Documented, feel free to shoot an email. -->
  28. <link rel="stylesheet" href="/static/david/css/style_2021-01-20.css">
  29. <!-- See https://www.zachleat.com/web/comprehensive-webfonts/ for the trade-off. -->
  30. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  31. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  32. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  33. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  34. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  35. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  36. <script>
  37. function toggleTheme(themeName) {
  38. document.documentElement.classList.toggle(
  39. 'forced-dark',
  40. themeName === 'dark'
  41. )
  42. document.documentElement.classList.toggle(
  43. 'forced-light',
  44. themeName === 'light'
  45. )
  46. }
  47. const selectedTheme = localStorage.getItem('theme')
  48. if (selectedTheme !== 'undefined') {
  49. toggleTheme(selectedTheme)
  50. }
  51. </script>
  52. <meta name="robots" content="noindex, nofollow">
  53. <meta content="origin-when-cross-origin" name="referrer">
  54. <!-- Canonical URL for SEO purposes -->
  55. <link rel="canonical" href="https://ia.net/writer/support/basics/markdown-guide">
  56. <body class="remarkdown h1-underline h2-underline h3-underline em-underscore hr-center ul-star pre-tick" data-instant-intensity="viewport-all">
  57. <article>
  58. <header>
  59. <h1>Basics, Tips and Tricks on how to use Markdown</h1>
  60. </header>
  61. <nav>
  62. <p class="center">
  63. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  64. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-home"></use>
  65. </svg> Accueil</a> •
  66. <a href="https://ia.net/writer/support/basics/markdown-guide" title="Lien vers le contenu original">Source originale</a>
  67. </p>
  68. </nav>
  69. <hr>
  70. <p>Our apps use Markdown formatting. This lets you apply basic formatting by adding a few punctuation characters. You can also use the formatting buttons in the bottom bar of your text window on OS X or the formatting keys in the Keyboard Bar of iA Writer for iOS.</p>
  71. <h2 id="basics">Basics</h2>
  72. <p>If you are not familiar with Markdown, it might look a little scary at first. Once you get the basics, you will quickly love it as it allows you to format your text without taking your hands off the keyboard. iA Writer’s Auto-Markdown will give you instant feedback if you got the formatting right or not.</p>
  73. <h3 id="headings">Headings</h3>
  74. <p>You can use up to up to six levels by writing # at the start of a line; the number of hashtags defines the hierarchy of the heading.</p>
  75. <pre><code># First level heading
  76. ## Second level heading
  77. ### Third level heading
  78. </code></pre>
  79. <h3>Emphasis and Importance</h3>
  80. <p>Emphasis (“italics”) and important (“bold”) are written by putting * or _ around the text you want to see in a different format.</p>
  81. <ul>
  82. <li>Emphasis: <code>*example*</code> or <code>_example_</code> (<code>⌘I</code>)</li>
  83. <li>Importance: <code>**example**</code> or <code>__example__</code> (<code>⌘B</code>)</li>
  84. <li>Emphasis + Importance <code>***example***</code> or <code>___example___</code></li>
  85. </ul>
  86. <h3>Strikethrough</h3>
  87. <p>You can use double tildes to make <del>strikethrough</del> text:</p>
  88. <pre><code>~~strikethrough~~</code></pre>
  89. <h3>Highlight</h3>
  90. <p>You can use double equals signs to <mark>highlight</mark> text:</p>
  91. <pre><code>==highlight==</code></pre>
  92. <h3 id="lists">Numbered Lists</h3>
  93. <p>Type <code>1.</code> then a space. Any number (followed by a full stop and space) can be used and the list items will be ordered from 1 when exported.</p>
  94. <pre><code>1. Ordered list item
  95. 2. Ordered list item
  96. 3. Ordered list item
  97. </code></pre>
  98. <h3>Bulleted Lists</h3>
  99. <p>Type <code>*</code>, <code>-</code> or <code>+</code> then a space. Create a bulleted list by using an asterisk (*), hyphen (-), or plus sign (+), followed by a space.</p>
  100. <pre><code>* Bulleted list item
  101. * Bulleted list item
  102. * Bulleted list item
  103. </code></pre>
  104. <h3 id="task-lists">Task Lists</h3>
  105. <p>Type <code>-[ ]</code> or <code>1.[ ]</code> then a space. Adding an <code>x</code> between the square brackets will tick off a task list item in the Preview. iA Writer for Mac and iOS also support clicking or tapping the list item marker to toggle it.</p>
  106. <pre><code>- [ ] Unfinished task list item
  107. - [x] Finished task list item
  108. </code></pre>
  109. <h3>Nesting Lists</h3>
  110. <p>You can nest lists several levels deep, and combine them:</p>
  111. <pre><code>* First level
  112. * Second level
  113. 1. First level
  114. 1. Second level
  115. * First level unordered list item
  116. 1. Second level ordered list item
  117. </code></pre>
  118. <p>Nested list items are indented with four spaces or a tab. iA Writer for iOS includes keys to indent and outdent list items. They can be found by tapping the <code>⌘</code> button in the keyboard bar.</p>
  119. <h3>Blockquotes</h3>
  120. <p>Type <code>&gt;</code> plus a space (just like email):</p>
  121. <pre><code>&gt; A quoted paragraph
  122. &gt;&gt; A quoted paragraph inside a quotation
  123. </code></pre>
  124. <p>iA Writer 5 offers a keyboard shortcut for blockquotes: <code>⌘</code>+<code>&gt;</code> These also now autocomplete in the same manner as lists.</p>
  125. <h2 id="advanced">Advanced</h2>
  126. <h3 id="links">Links</h3>
  127. <p>Create a link by surrounding the link text in square brackets, followed immediately by the URL in parentheses:</p>
  128. <pre><code>[text to link](http://example.com/)
  129. </code></pre>
  130. <p>You can also use reference links. Add the reference in square brackets after the text to link. Then, on a line by itself add the reference with a colon, space, and the URL:</p>
  131. <pre><code>[text to link][ref]
  132. [ref]: http://example.com/
  133. </code></pre>
  134. <h3 id="cross-references">Cross-References</h3>
  135. <p><strong>iA Writer for iOS, iPadOS and macOS</strong> support cross-references using the following syntax: </p>
  136. <pre><code># My Level 1 Header
  137. Some text and a link to [My Level 1 Header][].
  138. </code></pre>
  139. <p>In a document where <code># My Level 1 Header</code> exists. </p>
  140. <p>You can also use the following syntax: </p>
  141. <pre><code># My Level 1 Header
  142. Click here to [jump to section][My Level 1 Header]
  143. </code></pre>
  144. <p>You can define the label for a specific header by adding a space and <code>[Label]</code> following the header: </p>
  145. <pre><code># My Level 1 Header [My Label]
  146. </code></pre>
  147. <p>This can be referenced by: </p>
  148. <pre><code>Here is a link to [My Label][].
  149. or
  150. Click here to [jump to section][My Label].
  151. </code></pre>
  152. <p><strong>iA Writer for Windows</strong> supports cross-referencing headers using the following syntax: </p>
  153. <pre><code># Header
  154. [link text][Header]
  155. </code></pre>
  156. <p>You can use this like so:</p>
  157. <pre><code># My Level 1 Header
  158. Click here to [jump to section][My Level 1 Header].
  159. </code></pre>
  160. <h3 id="images">Images</h3>
  161. <p>Both local and web URLs are supported. Markdown uses the following syntax for images:</p>
  162. <pre><code>![](http://example.com/image.jpg)
  163. ![](./image.jpg)
  164. </code></pre>
  165. <p>When using local images, they must be in a folder added as a Library location. This gives iA Writer permission to use the file. Folders can be added as Locations by clicking the + beside the label in the Organizer on Mac, or by dragging them from Finder into the Location section. iOS supports images from any location except From Other Apps. To add a Location, tap <samp>Edit</samp> and then <samp>Add Location…</samp></p>
  166. <p><strong>Note:</strong> Markdown image syntax and HTML image filename rules are different from Content Blocks. When using Markdown syntax, spaces must be encoded as <code>%20</code>, and the leading slash must be omitted because it refers to the root directory of a device.</p>
  167. <h3 id="code">Code</h3>
  168. <p>You can mark up code in-line using backticks (<code>code</code>), or add a code block by adding at least four spaces to the start of a line:</p>
  169. <pre><code> This is a code block
  170. </code></pre>
  171. <p>In iA Writer, it’s also possible to start a code block with a tab, as long as the text doesn’t start with list, header or blockquote syntax characters (<code>1.</code>, <code>*</code>, <code>-</code>, <code>+</code>, <code>#</code>, <code>&gt;</code>).</p>
  172. <p>In addition, you can use Fenced code blocks, which begin and end with triple backticks, and don’t need indenting. <em>Note that inline formatting (like <code>_underscores_</code>) is ignored in code.</em></p>
  173. <pre><code>```
  174. This is a fenced code block
  175. ```
  176. </code></pre>
  177. <p>Add a footnote in square brackets preceded by a caret. Then add the footnote content like a reference link, for example:</p>
  178. <pre><code>Some text with a footnote[^1].
  179. [^1]: The linked footnote appears at the end of the document.
  180. </code></pre>
  181. <p>On Mac and iOS you can also add an inline footnote in the following manner:</p>
  182. <pre><code>Some text with a footnote[^This is the footnote itself.].
  183. </code></pre>
  184. <p>Note: Markdown was designed for web where there is no concept of pagination. As such footnotes are essentially endnotes. When rendered, these are placed at the end of the document.</p>
  185. <h3 id="toc">Table of Contents</h3>
  186. <p>Generating a table of content is as easy as it gets. Just add <code>{{TOC}}</code> wherever you want the table of content to appear and iA Writer generates it from the Headlines you use in your text. There is a custom key for it on iOS.</p>
  187. <p>On Mac you can add it via the toolbar or the Format Menu. The TOC will become visible and clickable in preview.</p>
  188. <h3 id="tables">Tables</h3>
  189. <p>To make a table, use vertical bar characters to denote cells. Start with column headers, separate with a row of cells with hyphens, then add further rows of cells. For example:</p>
  190. <pre><code>|Header |Column 1 | Column 2 | Column 3 |
  191. |:--- |:---- |:----:| ----:|
  192. |1. Row| is | is | is |
  193. |2. Row| left | nicely | right |
  194. |3. Row| aligned | centered | aligned |
  195. </code></pre>
  196. <p>Let’s be real. This is a mess. Markdown tables look more reasonable than HTML-Tables, but they are the weak point of Markdown. That being said, they still translate nicely when rendered:</p>
  197. <p><img decoding="async" src="/wp-content/uploads/2023/05/mdtable.png" alt></p>
  198. <p>iA Writer includes a menu option to automatically generate the cells for a table.</p>
  199. <p>There is a trick though you can use when writing Markdown tables with a monospaced font. You can feign the correct column width by adding space characters to align the table:</p>
  200. <p><img decoding="async" title="table.png" src="/wp-content/uploads/migration/table.png" alt="table.png"></p>
  201. <p> In Writer for Windows you can clean up a Markdown table by selecting the whole table and using <samp>Format</samp> → <samp>Table</samp> → <samp>Reformat</samp>.</p>
  202. <p><em>Note: If you find your table does not render correctly in Preview, please ensure Smart Dashes are turned off in <samp>Edit</samp> → <samp>Substitutions</samp>.</em></p>
  203. <h3>Separating Paragraphs</h3>
  204. <p>A line starting with a tab indicates a block of code. Because of this it is currently not possible to use a return-plus-tab to indicate a new paragraph in Writer. Instead, please use two returns to separate paragraphs.</p>
  205. <h3>Line Breaks</h3>
  206. <p>From the Markdown specification:</p>
  207. <blockquote>When you do want to insert a <code>&lt;br /&gt;</code> break tag using Markdown, you end a line with two or more spaces, then type return.</blockquote>
  208. <p>iA Writer also allows you to insert a <code>&lt;br /&gt;</code> into a paragraph by using Shift+Enter. This will add the spaces required at the end of the line for you.</p>
  209. <h3>Horizontal Rules</h3>
  210. <p>You can add a thematic break which will be represented by a dividing line (<code>&lt;hr&gt;</code>) when exported to HTML. To do so, add three or more asterisks (<code>*</code>), hyphens (<code>-</code>), or underscores (<code>_</code>) on a line by themselves, optionally separated with spaces. For example:</p>
  211. <pre><code>* * *
  212. </code></pre>
  213. <p>or</p>
  214. <pre><code>-------------
  215. </code></pre>
  216. <h3>Page Breaks</h3>
  217. <p>Sometimes your document doesn’t flow exactly how you want it when printing or exporting to PDF. You can force a page break in iA Writer using three plus marks (<code>+</code>) on a line by themselves:</p>
  218. <pre><code>+++
  219. </code></pre>
  220. <p><em>Note: Manual page breaks are currently unavailable in iA Writer for Android.</em></p>
  221. <p>Markdown doesn’t have an official syntax for comments. So we don’t try to make a bespoke one that will only render correctly in iA Writer.</p>
  222. <p>Since HTML is completely valid in Markdown, you can use HTML comments instead:</p>
  223. <pre><code>&lt;!-- This is a comment --&gt;</code></pre>
  224. <h3>“Escaping” Formatting Characters</h3>
  225. <p>If you want to type a formatting character and have Writer treat it as text not formatting, type a backslash first <code>\</code>. This means <code>\*</code> gives <code>*</code>, <code>\_</code> gives <code>_</code> etc. Escaping isn’t needed in code blocks.</p>
  226. <h3 id="math">Math</h3>
  227. <p>iA Writer supports TeX math expressions on Mac and iOS. These are easy to write in plain text and then formatted beautifully in the Preview.
  228. For inline expressions, use <code>$</code> or <code>\\(</code> and <code>\\)</code>:</p>
  229. <pre><code>An example of math within a paragraph --- \\({e}^{i\pi }+1=0\\)
  230. Or use dollar signs instead --- ${e}^{i\pi }+1=0$
  231. </code></pre>
  232. <p>For block format expressions, use <code>$$</code> or <code>\\[</code> and <code>\\]</code>:</p>
  233. <pre><code>To show an expression by itself:
  234. \\[ {x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a} \\]
  235. or:
  236. $${x}_{1,2}=\frac{-b\pm \sqrt{{b}^{2}-4ac}}{2a}$$
  237. </code></pre>
  238. <p>If using the dollar sign syntax, there must be no space between the <code>$</code> and the contents of the expression and there must be space on the outside.</p>
  239. <p>iA Writer supports metadata at the beginning of documents. You can use it store important information about your documents, hidden from Preview. Metadata must be separated from the rest of the document by three dashes:</p>
  240. <p>You can use metadata to build correspondence Templates.</p>
  241. <p><img decoding="async" class="support-box-shadow" src="https://ia.net/wp-content/uploads/2020/05/bluth.png" alt></p>
  242. <p>You can do this with two easy steps. First you define your metadata at the very top of your document, followed by an empty line. Let’s write “The Cat sat on the Mat” with metadata. Write:</p>
  243. <pre><code>---
  244. Animal: Cat
  245. Thing: Mat
  246. ---
  247. </code></pre>
  248. <p>You can use the metadata in the text by putting it in brackets adding a % sign. Write:</p>
  249. <pre><code>The [%Animal] sat on the [%Thing].
  250. </code></pre>
  251. <p>The whole document should now look like this:</p>
  252. <pre><code>---
  253. Animal: Cat
  254. Thing: Mat
  255. ---
  256. The [%Animal] sat on the [%Thing].
  257. </code></pre>
  258. <p>If you open Preview and compare the raw text and the rendered Markdown you will see this:</p>
  259. <p><img decoding="async" class="support-box-shadow" src="https://ia.net/wp-content/uploads/2020/05/cat.png" alt></p>
  260. <h2 id="smart-automation">Smart Automation</h2>
  261. <p>Peppered throughout iA Writer’s documentation and settings you will see references to various “Smart” features. As a rule, these provide some form of automatic text completion or transformation so you can keep focused on writing instead of dealing with minutiae.</p>
  262. <h3>Smart Lists</h3>
  263. <p>Once you begin writing a list in iA Writer, a bullet/list marker of the same type will be created automatically when you hit return. Hitting return twice in a row removes the empty list item and exits the list so no further items will be created.</p>
  264. <p>Blockquotes in iA Writer 5 now behave the same way.</p>
  265. <h3>Smart Substitutions in the Editor</h3>
  266. <p>These options are found in <samp>Preferences</samp> → <samp>Editor</samp> → <samp>Smart substitions</samp> on Mac and <samp>Settings</samp> → <samp>Editor</samp> → <samp>Text Input</samp> on iOS.</p>
  267. <p>When <samp>Smart Copy/Paste</samp> is turned on, spaces are added around content pasted into the Editor automatically.</p>
  268. <p>When activated, <samp>Smart Quotes</samp> will automatically replace any straight quotes written in the Editor with curly quotes, as you write. <samp>Smart Dashes</samp> works in a similar way, substituting a dash in the Editor whenever two hyphens are written consecutively.</p>
  269. <h3>Smart Punctuation (Markdown)</h3>
  270. <p>This option is found in <samp>Preferences</samp> → <samp>Templates</samp> → <samp>Markdown processing</samp> on Mac and <samp>Settings</samp> → <samp>Templates</samp> → <samp>Markdown processing</samp> on iOS.</p>
  271. <p>When turned on, it will convert straight quotes and doubled hyphens in the typed in the Editor into curly quotes and dashes in the Preview, respectively.</p>
  272. <p>Using this option will <em>not</em> affect text in the Editor, it only makes the change in the Preview as the Markdown is processed.</p>
  273. <h3>Smart Tables</h3>
  274. <p>New in iA Writer for Mac and iOS, you can use the syntax <code>=(…)</code> to perform mathematical calculations in your tables.</p>
  275. <ul>
  276. <li>You can also reference other cells in these calculations</li>
  277. <li>Cell IDs start at A0 from the top-left, like in spreadsheets</li>
  278. <li>Calculations are handled by <a href="http://mathjs.org/" rel="nofollow noopener" target="_blank">math.js</a></li>
  279. </ul>
  280. <table><colgroup> <col> <col> </colgroup>
  281. <thead>
  282. <tr>
  283. <th>Editor Input</th>
  284. <th>Preview Output</th>
  285. </tr>
  286. </thead>
  287. <tbody>
  288. <tr>
  289. <td><code>1</code></td>
  290. <td>1</td>
  291. </tr>
  292. <tr>
  293. <td><code>=(2 + 2)</code></td>
  294. <td>4</td>
  295. </tr>
  296. <tr>
  297. <td><code>=(51 / 3)</code></td>
  298. <td>17</td>
  299. </tr>
  300. <tr>
  301. <td><code>=(B1 + B3)</code></td>
  302. <td>18</td>
  303. </tr>
  304. <tr>
  305. <td><code>=(TOTAL)</code></td>
  306. <td>40</td>
  307. </tr>
  308. </tbody>
  309. </table>
  310. <p>N.B. To avoid formatting and calculation errors in Smart Tables, please use spaces on either side of arithmetic operators (<code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>).</p>
  311. <p>Additionally, you can make use of metadata variables:</p>
  312. <pre><code>---
  313. Var: 1
  314. ---</code></pre>
  315. <table><colgroup> <col> <col> </colgroup>
  316. <thead>
  317. <tr>
  318. <th><strong>Editor Input</strong></th>
  319. <th><strong>Preview Output</strong></th>
  320. </tr>
  321. </thead>
  322. <tbody>
  323. <tr>
  324. <td><code>=([%Var] + 0)</code></td>
  325. <td>1</td>
  326. </tr>
  327. <tr>
  328. <td><code>=([%Var] + 1)</code></td>
  329. <td>2</td>
  330. </tr>
  331. <tr>
  332. <td><code>=([%Var] + 2)</code></td>
  333. <td>3</td>
  334. </tr>
  335. </tbody>
  336. </table>
  337. <p>You can also perform unit conversion:</p>
  338. <table><colgroup> <col> <col> </colgroup>
  339. <thead>
  340. <tr>
  341. <th><strong>Editor Input</strong></th>
  342. <th><strong>Preview Output</strong></th>
  343. </tr>
  344. </thead>
  345. <tbody>
  346. <tr>
  347. <td><code>=(25 m/s to km/h)</code></td>
  348. <td>90 km / h</td>
  349. </tr>
  350. <tr>
  351. <td><code>=(2.2046226218487757 lbs to kg)</code></td>
  352. <td>1 kg</td>
  353. </tr>
  354. <tr>
  355. <td><code>=(460 V * 20 A * 30 days to kWh)</code></td>
  356. <td>6624 kWh</td>
  357. </tr>
  358. </tbody>
  359. </table>
  360. <h2 id="preview">Preview</h2>
  361. <p>Writer apps use Markdown formatting, so you can format your text just by typing. It’s familiar, and it’s also subtly formatted on-screen using Auto Markdown:</p>
  362. <p><img decoding="async" src="/wp-content/uploads/migration/editor.png"></p>
  363. <p>Writer also provides a formatted preview of your document:</p>
  364. <h5>iA Writer for Mac</h5>
  365. <p>Choose <samp>View</samp> → <samp>Show Preview</samp> or <kbd>⌘</kbd><kbd>R</kbd> or swipe to the left</p>
  366. <h5>iA Writer for iPad and iPhone</h5>
  367. <p>Tap the Preview button at the top right</p>
  368. <h5>iA Writer for Windows</h5>
  369. <p>Choose <samp>View</samp> → <samp>Preview</samp> or <kbd>ctrl</kbd><kbd>R</kbd></p>
  370. <h5>iA Writer for Android</h5>
  371. <p>Tap <span><samp>⋮</samp></span> → <samp>Preview</samp> or swipe to the left</p>
  372. <h2 id="exporting">Exporting</h2>
  373. <p>iA Writer supports exporting as plain text, HTML, Microsoft Word 2007 (.docx), and PDF via <samp>File</samp> → <samp>Export</samp>.</p>
  374. <p>You can also export as PDF on Mac via either:
  375. <samp>File</samp> → <samp>Print</samp> → <samp>PDF</samp>
  376. <samp>File</samp> → <samp>Print Plain Text</samp> → <samp>PDF</samp></p>
  377. <p>Finally, you can copy formatted text from Writer’s Preview to paste into other programs.</p>
  378. </article>
  379. <hr>
  380. <footer>
  381. <p>
  382. <a href="/david/" title="Aller à l’accueil"><svg class="icon icon-home">
  383. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-home"></use>
  384. </svg> Accueil</a> •
  385. <a href="/david/log/" title="Accès au flux RSS"><svg class="icon icon-rss2">
  386. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-rss2"></use>
  387. </svg> Suivre</a> •
  388. <a href="http://larlet.com" title="Go to my English profile" data-instant><svg class="icon icon-user-tie">
  389. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-user-tie"></use>
  390. </svg> Pro</a> •
  391. <a href="mailto:david%40larlet.fr" title="Envoyer un courriel"><svg class="icon icon-mail">
  392. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-mail"></use>
  393. </svg> Email</a> •
  394. <abbr class="nowrap" title="Hébergeur : Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33184162340"><svg class="icon icon-hammer2">
  395. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-hammer2"></use>
  396. </svg> Légal</abbr>
  397. </p>
  398. <template id="theme-selector">
  399. <form>
  400. <fieldset>
  401. <legend><svg class="icon icon-brightness-contrast">
  402. <use xlink:href="/static/david/icons2/symbol-defs-2021-12.svg#icon-brightness-contrast"></use>
  403. </svg> Thème</legend>
  404. <label>
  405. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  406. </label>
  407. <label>
  408. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  409. </label>
  410. <label>
  411. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  412. </label>
  413. </fieldset>
  414. </form>
  415. </template>
  416. </footer>
  417. <script src="/static/david/js/instantpage-5.1.0.min.js" type="module"></script>
  418. <script>
  419. function loadThemeForm(templateName) {
  420. const themeSelectorTemplate = document.querySelector(templateName)
  421. const form = themeSelectorTemplate.content.firstElementChild
  422. themeSelectorTemplate.replaceWith(form)
  423. form.addEventListener('change', (e) => {
  424. const chosenColorScheme = e.target.value
  425. localStorage.setItem('theme', chosenColorScheme)
  426. toggleTheme(chosenColorScheme)
  427. })
  428. const selectedTheme = localStorage.getItem('theme')
  429. if (selectedTheme && selectedTheme !== 'undefined') {
  430. form.querySelector(`[value="${selectedTheme}"]`).checked = true
  431. }
  432. }
  433. const prefersColorSchemeDark = '(prefers-color-scheme: dark)'
  434. window.addEventListener('load', () => {
  435. let hasDarkRules = false
  436. for (const styleSheet of Array.from(document.styleSheets)) {
  437. let mediaRules = []
  438. for (const cssRule of styleSheet.cssRules) {
  439. if (cssRule.type !== CSSRule.MEDIA_RULE) {
  440. continue
  441. }
  442. // WARNING: Safari does not have/supports `conditionText`.
  443. if (cssRule.conditionText) {
  444. if (cssRule.conditionText !== prefersColorSchemeDark) {
  445. continue
  446. }
  447. } else {
  448. if (cssRule.cssText.startsWith(prefersColorSchemeDark)) {
  449. continue
  450. }
  451. }
  452. mediaRules = mediaRules.concat(Array.from(cssRule.cssRules))
  453. }
  454. // WARNING: do not try to insert a Rule to a styleSheet you are
  455. // currently iterating on, otherwise the browser will be stuck
  456. // in a infinite loop…
  457. for (const mediaRule of mediaRules) {
  458. styleSheet.insertRule(mediaRule.cssText)
  459. hasDarkRules = true
  460. }
  461. }
  462. if (hasDarkRules) {
  463. loadThemeForm('#theme-selector')
  464. }
  465. })
  466. </script>
  467. </body>
  468. </html>