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