1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565
|
<pre>Internet Engineering Task Force (IETF) S. Leonard
Request for Comments: 7764 Penango, Inc.
Category: Informational March 2016
ISSN: 2070-1721
<span class="h1">Guidance on Markdown:</span>
<span class="h1">Design Philosophies, Stability Strategies, and Select Registrations</span>
Abstract
This document elaborates upon the text/markdown media type for use
with Markdown, a family of plain-text formatting syntaxes that
optionally can be converted to formal markup languages such as HTML.
Background information, local storage strategies, and additional
syntax registrations are supplied.
Status of This Memo
This document is not an Internet Standards Track specification; it is
published for informational purposes.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Not all documents
approved by the IESG are a candidate for any level of Internet
Standard; see <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc7764">http://www.rfc-editor.org/info/rfc7764</a>.
Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
<span class="grey">Leonard Informational [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
Table of Contents
<a href="#section-1">1</a>. Dive into Markdown . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-1.1">1.1</a>. On Formats . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a>
<a href="#section-1.2">1.2</a>. Markdown Design Philosophy . . . . . . . . . . . . . . . . <a href="#page-4">4</a>
<a href="#section-1.3">1.3</a>. Uses of Markdown . . . . . . . . . . . . . . . . . . . . . <a href="#page-5">5</a>
<a href="#section-1.4">1.4</a>. Uses of Labeling Markdown Content as text/markdown . . . . <a href="#page-6">6</a>
<a href="#section-1.5">1.5</a>. Definitions . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-6">6</a>
<a href="#section-2">2</a>. Strategies for Preserving Media Type and Parameters . . . . . <a href="#page-7">7</a>
<a href="#section-2.1">2.1</a>. Map to Filename and Attributes . . . . . . . . . . . . . . <a href="#page-7">7</a>
<a href="#section-2.2">2.2</a>. Store Headers in Adjacent File . . . . . . . . . . . . . . <a href="#page-8">8</a>
<a href="#section-2.3">2.3</a>. "Arm" Content with MIME Headers . . . . . . . . . . . . . . <a href="#page-8">8</a>
<a href="#section-2.4">2.4</a>. Create a Local Batch Script . . . . . . . . . . . . . . . . <a href="#page-9">9</a>
<a href="#section-2.5">2.5</a>. Process the Markdown in Advance . . . . . . . . . . . . . . <a href="#page-9">9</a>
<a href="#section-2.6">2.6</a>. Rely on Context . . . . . . . . . . . . . . . . . . . . . . <a href="#page-9">9</a>
<a href="#section-2.7">2.7</a>. Specific Strategies . . . . . . . . . . . . . . . . . . . . <a href="#page-9">9</a>
<a href="#section-2.7.1">2.7.1</a>. Subversion . . . . . . . . . . . . . . . . . . . . . . <a href="#page-9">9</a>
<a href="#section-2.7.2">2.7.2</a>. Git . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-10">10</a>
<a href="#section-3">3</a>. Registration Templates for Common Markdown Syntaxes . . . . . <a href="#page-10">10</a>
<a href="#section-3.1">3.1</a>. MultiMarkdown . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-10">10</a>
<a href="#section-3.2">3.2</a>. GitHub-Flavored Markdown . . . . . . . . . . . . . . . . . <a href="#page-11">11</a>
<a href="#section-3.3">3.3</a>. Pandoc . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a>
<a href="#section-3.4">3.4</a>. Fountain (Fountain.io) . . . . . . . . . . . . . . . . . . <a href="#page-14">14</a>
<a href="#section-3.5">3.5</a>. CommonMark . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-14">14</a>
<a href="#section-3.6">3.6</a>. kramdown-rfc2629 (Markdown for RFCs) . . . . . . . . . . . <a href="#page-15">15</a>
<a href="#section-3.7">3.7</a>. <a href="./rfc7328">rfc7328</a> (Pandoc2rfc) . . . . . . . . . . . . . . . . . . . <a href="#page-16">16</a>
<a href="#section-3.8">3.8</a>. PHP Markdown Extra . . . . . . . . . . . . . . . . . . . . <a href="#page-16">16</a>
<a href="#section-4">4</a>. Examples for Common Markdown Syntaxes . . . . . . . . . . . . <a href="#page-17">17</a>
<a href="#section-4.1">4.1</a>. MultiMarkdown . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-17">17</a>
<a href="#section-4.2">4.2</a>. GitHub Flavored Markdown . . . . . . . . . . . . . . . . . <a href="#page-18">18</a>
<a href="#section-4.3">4.3</a>. Pandoc . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-19">19</a>
<a href="#section-4.4">4.4</a>. Fountain (Fountain.io) . . . . . . . . . . . . . . . . . . <a href="#page-20">20</a>
<a href="#section-4.5">4.5</a>. CommonMark . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-21">21</a>
<a href="#section-4.6">4.6</a>. kramdown-rfc2629 (Markdown for RFCs) . . . . . . . . . . . <a href="#page-22">22</a>
<a href="#section-4.7">4.7</a>. <a href="./rfc7328">rfc7328</a> (Pandoc2rfc) . . . . . . . . . . . . . . . . . . . <a href="#page-25">25</a>
<a href="#section-5">5</a>. IANA Considerations . . . . . . . . . . . . . . . . . . . . . <a href="#page-25">25</a>
<a href="#section-6">6</a>. Security Considerations . . . . . . . . . . . . . . . . . . . . <a href="#page-26">26</a>
<a href="#section-7">7</a>. References . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-26">26</a>
<a href="#section-7.1">7.1</a>. Normative References . . . . . . . . . . . . . . . . . . . <a href="#page-26">26</a>
<a href="#section-7.2">7.2</a>. Informative References . . . . . . . . . . . . . . . . . . <a href="#page-26">26</a>
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-28">28</a>
<span class="grey">Leonard Informational [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Dive into Markdown</span>
This document serves as an informational companion to [<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>], the
text/markdown media type registration. It should be considered
jointly with [<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>].
"Sometimes the truth of a thing is not so much in the think of
it, but in the feel of it." -- Stanley Kubrick
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. On Formats</span>
In computer systems, textual data is stored and processed using a
continuum of techniques. On the one end is plain text: computer-
encoded text that consists only of a sequence of code points from a
given standard, with no other formatting or structural information
[<a href="#ref-UNICODE" title=""The Unicode Standard, Version 8.0"">UNICODE</a>]. Plain text provides /some/ fixed facilities for
formatting instructions (namely, codes in the character set that have
meanings other than "represent this character graphically on the
output medium"); however, these facilities are not particularly
extensible. Compare with <a href="./rfc6838#section-4.2.1">Section 4.2.1 of [RFC6838]</a>. Applications
may neuter the effects of these special characters by prohibiting
them or by ignoring their dictated meanings, as is the case with how
modern applications treat most control characters in US-ASCII. On
this end, any text reader or editor that interprets the character set
can be used to see or manipulate the text. If some characters are
corrupted, the corruption is unlikely to affect the ability of a
computer system to process the text (even if the human meaning is
changed).
On the other end is binary data: a sequence of bits intended for some
computer application to interpret and act upon. Binary formats are
flexible in that they can store non-textual data efficiently (perhaps
storing no text at all, or only storing certain kinds of text for
very specialized purposes). Binary formats require an application to
be coded specifically to handle the format; no partial
interoperability is possible. Furthermore, if even one bit is
corrupted in a binary format, it may prevent an application from
processing any of the data correctly.
Between these two extremes lies formatted text, i.e., text that
includes non-textual information coded in a particular way, that
affects the interpretation of the text by computer programs.
Formatted text is distinct from plain text and binary data in that
the non-textual information is encoded into textual characters that
are assigned specialized meanings not defined by the character set.
With a regular text editor and a standard keyboard (or other standard
input mechanism), a user can enter these textual characters to
express the non-textual meanings. For example, a character like "<"
<span class="grey">Leonard Informational [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
no longer means "LESS-THAN SIGN"; it means the start of a tag or
element that affects the document in some way.
On the formal end of the formatted text spectrum is markup, a family
of languages for annotating a document in such a way that the
annotations are syntactically distinguishable from the text. Markup
languages are (reasonably) well-specified and tend to follow (mostly)
standardized syntax rules. Examples of markup languages include
Standard Generalized Markup Language (SGML), HTML, XML, and LaTeX.
Standardized rules lead to interoperability between markup
processors, but a skill requirement for new (human) users of the
language that they learn these rules in order to do useful work.
This imposition makes markup less accessible for non-technical users
(i.e., users who are unwilling or unable to invest in the requisite
skill development).
informal /---------formatted text----------\ formal
<------v-------------v-------------v-----------------------v---->
plain text informal markup formal markup binary format
(Markdown) (HTML, XML, etc.)
Figure 1: Degrees of Formality in Data-Storage Formats for Text
On the informal end of the spectrum are lightweight markup languages.
In comparison with formal markup like XML, lightweight markup uses
simple syntax, and is designed to be easy for humans to enter with
basic text editors. Markdown, the subject of this document, is an
/informal/ plain-text formatting syntax that is intentionally
targeted at non-technical users (i.e., users upon whom little to no
skill development is imposed) using unspecialized tools (i.e., text
boxes). Jeff Atwood once described these informal markup languages
as "humane" [<a href="#ref-HUMANE" title=""Is HTML a Humane Markup Language?"">HUMANE</a>].
<span class="h3"><a class="selflink" id="section-1.2" href="#section-1.2">1.2</a>. Markdown Design Philosophy</span>
Markdown specifically is a family of syntaxes that are based on the
original work of John Gruber with substantial contributions from
Aaron Swartz, released in 2004 [<a href="#ref-MARKDOWN" title=""Daring Fireball: Markdown"">MARKDOWN</a>]. Since its release, a
number of web or web-facing applications have incorporated Markdown
into their text-entry systems, frequently with custom extensions.
Fed up with the complexity and security pitfalls of formal markup
languages (e.g., HTML5) and proprietary binary formats (e.g.,
commercial word-processing software), yet unwilling to be confined to
the restrictions of plain text, many users have turned to Markdown
for document processing. Whole toolchains now exist to support
Markdown for online and offline projects.
<span class="grey">Leonard Informational [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
Informality is a bedrock premise of Gruber's design. Gruber created
Markdown after disastrous experiences with strict XML and XHTML
processing of syndicated feeds. In Mark Pilgrim's "thought
experiment", several websites went down because one site included
invalid XHTML in a blog post, which was automatically copied via
trackbacks across other sites [<a href="#ref-DIN2MD" title=""Dive Into Markdown"">DIN2MD</a>]. These scenarios led Gruber
to believe that clients (e.g., web browsers) SHOULD try to make sense
of data that they receive, rather than rejecting data simply because
it fails to adhere to strict, unforgiving standards. (In [<a href="#ref-DIN2MD" title=""Dive Into Markdown"">DIN2MD</a>],
Gruber compared Postel's Law [<a href="./rfc793" title=""Transmission Control Protocol"">RFC793</a>] with the XML standard, which
says: "Once a fatal error is detected [...] the processor MUST NOT
continue normal processing" [<a href="#ref-XML1.0-5" title=""Extensible Markup Language (XML) 1.0 (Fifth Edition)"">XML1.0-5</a>].) As a result, there is no
such thing as "invalid" Markdown, there is no standard demanding
adherence to the Markdown syntax, and there is no governing body that
guides or impedes its development. If the Markdown syntax does not
result in the "right" output (defined as output that the author
wants, not output that adheres to some dictated system of rules),
Gruber's view is that the author either should keep on experimenting
or should change the processor to address the author's particular
needs (see [<a href="#ref-MARKDOWN" title=""Daring Fireball: Markdown"">MARKDOWN</a>] Readme and [<a href="#ref-MD102b8" title=""Subject: [ANN] Markdown.pl 1.0.2b8"">MD102b8</a>] perldoc; see also
[<a href="#ref-CATPICS" title=""The Talk Show: Ep. 88: 'Cat Pictures' (Side 1)"">CATPICS</a>]).
<span class="h3"><a class="selflink" id="section-1.3" href="#section-1.3">1.3</a>. Uses of Markdown</span>
Since its introduction in 2004, Markdown has enjoyed remarkable
success. Markdown works for users for three key reasons. First, the
markup instructions (in text) look similar to the markup that they
represent; therefore, the cognitive burden to learn the syntax is
low. Second, the primary arbiter of the syntax's success is *running
code*. The tool that converts the Markdown to a presentable format,
and not a series of formal pronouncements by a standards body, is the
basis for whether syntactic elements matter. Third, Markdown has
become something of an Internet meme [<a href="#ref-INETMEME" title=""Richard Dawkins on the internet's hijacking of the word 'meme'"">INETMEME</a>], in that Markdown
gets received, reinterpreted, and reworked as additional communities
encounter it. There are communities that are using Markdown for
scholarly writing [<a href="#ref-OCCASION" title=""Switching to Markdown for scholarly article production"">OCCASION</a>], for screenplays [<a href="#ref-FOUNTAIN" title=""Fountain | A markup language for screenwriting."">FOUNTAIN</a>], and even
for mathematical formulae [<a href="#ref-MATHDOWN" title=""math in markdown"">MATHDOWN</a>]. Clearly, a screenwriter has no
use for specialized Markdown syntax for mathematicians; likewise,
mathematicians do not need to identify characters or props in common
ways. The overall gist is that all of these communities can take the
common elements of Markdown (which are rooted in the common elements
of HTML circa 2004) and build on them in ways that best fit their
needs.
<span class="grey">Leonard Informational [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-1.4" href="#section-1.4">1.4</a>. Uses of Labeling Markdown Content as text/markdown</span>
The primary purpose of an Internet media type is to label "content"
on the Internet, as distinct from "files". Content is any computer-
readable format that can be represented as a primary sequence of
octets, along with type-specific metadata (parameters) and type-
agnostic metadata (protocol dependent). From this description, it is
apparent that appending ".markdown" to the end of a filename is not a
sufficient means to identify Markdown. Filenames are properties of
files in file systems, but Markdown frequently exists in databases or
content management systems (CMSes) where the file metaphor does not
apply. One CMS [<a href="#ref-RAILFROG" title=""Railfrog"">RAILFROG</a>] uses media types to select appropriate
processing, so a media type is necessary for the safe and
interoperable use of Markdown.
Unlike complete HTML documents, [<a href="#ref-MDSYNTAX" title=""Daring Fireball: Markdown Syntax Documentation"">MDSYNTAX</a>] provides no means to
include metadata in the content stream. Several derivative flavors
have invented metadata incorporation schemes (e.g., [<a href="#ref-MULTIMD" title=""MultiMarkdown"">MULTIMD</a>]), but
these schemes only address specific use cases. In general, the
metadata must be supplied via supplementary means in an encapsulating
protocol, format, or convention. The relationship between the
content and the metadata is not directly addressed here or in
[<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>]; however, by identifying Markdown with a media type,
Markdown content can participate as a first-class citizen with a wide
spectrum of metadata schemes.
Finally, registering a media type through the IETF process is not
trivial. Markdown can no longer be considered a "vendor"-specific
innovation, but the registration requirements even in the vendor tree
have proven to be overly burdensome for most Markdown implementers.
Moreover, registering hundreds of Markdown variants with distinct
media types would impede interoperability: virtually all Markdown
content can be processed by virtually any Markdown processor, with
varying degrees of success. The goal of [<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>] is to reduce all
of these burdens by having one media type that accommodates diversity
and eases registration.
<span class="h3"><a class="selflink" id="section-1.5" href="#section-1.5">1.5</a>. Definitions</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
Since Markdown signifies a family of related formats with varying
degrees of formal documentation and implementation, this
specification uses the term "variant" to identify such formats.
<span class="grey">Leonard Informational [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Strategies for Preserving Media Type and Parameters</span>
The purpose of this document and [<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>] is to promote
interoperability between different Markdown-related systems,
preserving the author's intent. While [<a href="#ref-MARKDOWN" title=""Daring Fireball: Markdown"">MARKDOWN</a>] was designed by
Gruber in 2004 as a simple way to write blog posts and comments, as
of 2014 Markdown and its derivatives are rapidly becoming the formats
of record for many communities and use cases. While an individual
member of (or software tool for) a community can probably look at
some "Markdown" and declare its meaning intuitively obvious, software
systems in different communities (or different times) need help.
[<a href="#ref-MDSYNTAX" title=""Daring Fireball: Markdown Syntax Documentation"">MDSYNTAX</a>] does not have a signaling mechanism like <!DOCTYPE>, so
tagging Markdown internally is simply out of the question. Once tags
or metadata are introduced, the content is no longer "just" Markdown.
Some commentators have suggested that an in-band signaling mechanism,
such as in Markdown link definitions at the top of the content, could
be used to signal the variant. Unfortunately, this signaling
mechanism is incompatible with other Markdown variants (e.g.,
[<a href="#ref-PANDOC" title=""Pandoc"">PANDOC</a>]) that expect their own kinds of metadata at the top of the
file. Markdown content is just a stream of text; the semantics of
that text can only be furnished by context.
The media type and variant parameter in [<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>] furnish this
missing context, while allowing for additional extensibility. This
section covers strategies for how an application might preserve
metadata when it leaves the domain of IETF protocols.
[<a id="ref-RFC7763">RFC7763</a>] only defines two parameters: the charset parameter
(required for all text/* media types) and the variant parameter.
[<a href="./rfc6657" title=""Update to MIME regarding "">RFC6657</a>] provides guidance on character-set parameter handling. The
variant parameter provides a simple identifier -- nothing less or
more. Variants are allowed to define additional parameters when sent
with the text/markdown media type; the variant can also introduce
control information into the textual content stream (such as via a
metadata block). Neither [<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>] nor this specification recommend
any particular approach. However, the philosophy behind [<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>] is
to preserve formats rather than create new ones, since supporting
existing toolchains is more realistic than creating novel ones that
lack traction in the Markdown community.
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a>. Map to Filename and Attributes</span>
This strategy is to map the media type, variant, and parameters to
"attributes" or "forks" in the local convention. Firstly, Markdown
content saved to a file should have an appropriate file extension
ending in .md or .markdown, which serves to disambiguate it from
other kinds of files. The character repertoire of variant
<span class="grey">Leonard Informational [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
identifiers in [<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>] is designed to be compatible with most
filename conventions. Therefore, a recommended strategy is to record
the variant identifier as the prefix to the file extension. For
example, for [<a href="#ref-PANDOC" title=""Pandoc"">PANDOC</a>] content, a file could be named
"example.pandoc.markdown".
Many filesystems are case-sensitive or case-preserving; however, file
extensions tend to be all lowercase. This document takes no position
on whether variant identifiers should be case-preserved or all
lowercase when Markdown content is written to a file. However, when
the variant identifier is read to influence operational behavior, it
needs to be compared case-insensitively.
Many modern filesystems support "extended attributes", "alternate
data streams", or "resource forks". Some version control systems
support named properties. If the variant defines additional
parameters, these parameters should be stored in these resources,
where the parameter name includes the name of the resource, and the
parameter value is the value of the resource (data in the resource),
preferably UTF-8 encoded (unless the parameter definition explicitly
defines a different encoding or repertoire). The variant identifier
itself should be stored in a resource with a name including the term
"variant" (possibly including other decorations to avoid namespace
collisions).
<span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a>. Store Headers in Adjacent File</span>
This strategy is to save the Markdown content in a first file and to
save the metadata (specifically the Content-Type header) in a second
file with a filename that is rationally related to the first
filename. For example, if the first file is named "readme.markdown",
the second file could be named "readme.markdown.headers". (If stored
in a database, the analogy would be to store the metadata in a second
table with a field that is a key to the first table.) This header
file has the media type message/global-headers [<a href="./rfc6533" title=""Internationalized Delivery Status and Disposition Notifications"">RFC6533</a>] (".u8hdr"
suggestion notwithstanding).
<span class="h3"><a class="selflink" id="section-2.3" href="#section-2.3">2.3</a>. "Arm" Content with MIME Headers</span>
This strategy is to save the Markdown content along with its headers
in a file, "arming" the content by prepending the MIME headers
(specifically the Content-Type header). It should be appreciated
that the file is no longer a "Markdown file"; rather, it is an
Internet Message Format file (e.g., [<a href="./rfc5322" title=""Internet Message Format"">RFC5322</a>]) with a Markdown
content part. Therefore, the file should have an Internet message
extension (e.g., ".eml", ".msg", or ".u8msg"), not a Markdown
extension (e.g., ".md" or ".markdown").
<span class="grey">Leonard Informational [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-2.4" href="#section-2.4">2.4</a>. Create a Local Batch Script</span>
This strategy is to translate the processing instructions inferred
from the Content-Type and other parameters (e.g., Content-
Disposition) into a sequence of commands in the local convention,
storing those commands in a batch script. For example, when a MIME-
aware client stores some Markdown to disk, the client can save a
Makefile in the same directory with commands that are appropriate
(and safe) for the local system.
<span class="h3"><a class="selflink" id="section-2.5" href="#section-2.5">2.5</a>. Process the Markdown in Advance</span>
This strategy is to process the Markdown into the formal markup,
before a recipient receives it; this eliminates ambiguities. Once
the Markdown is processed into (for example) valid XHTML, an
application can save a file as "doc.xhtml" or can send MIME content
as application/xhtml+xml with no further loss of metadata. While
unambiguous, this process may not be reversible.
<span class="h3"><a class="selflink" id="section-2.6" href="#section-2.6">2.6</a>. Rely on Context</span>
This last strategy is to use or create context to determine how to
interpret the Markdown. For example, Markdown content that is of the
Fountain.io type [<a href="#ref-FOUNTAIN" title=""Fountain | A markup language for screenwriting."">FOUNTAIN</a>] could be saved with the filename
"script.fountain" instead of "script.markdown". Alternatively,
scripts could be stored in a "/screenplays" directory while other
kinds of Markdown could be stored elsewhere. For reasons that should
be intuitively obvious, this method is the most error-prone.
"Context" can be easily lost over time, and the trend of passing
Markdown between systems -- taking them *out* of context -- is
increasing.
<span class="h3"><a class="selflink" id="section-2.7" href="#section-2.7">2.7</a>. Specific Strategies</span>
<span class="h4"><a class="selflink" id="section-2.7.1" href="#section-2.7.1">2.7.1</a>. Subversion</span>
This subsection covers a preservation strategy in Subversion [<a href="#ref-SVN" title="December 2015">SVN</a>], a
common client-server version control system.
Subversion supports named properties. The "svn:mime-type" property
duplicates the entire Content-Type header, so parameters SHOULD be
stored there (<a href="#section-2.1">Section 2.1</a>). The filename SHOULD be consistent with
this Content-Type header, i.e., the extension SHOULD be the variant
identifier plus ".markdown" (<a href="#section-2.1">Section 2.1</a>).
<span class="grey">Leonard Informational [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h4"><a class="selflink" id="section-2.7.2" href="#section-2.7.2">2.7.2</a>. Git</span>
This subsection covers a preservation strategy in Git [<a href="#ref-GIT">GIT</a>], a common
distributed version control system.
Versions of Git as of the time of this writing do not support
arbitrary metadata storage; however, third-party projects add this
support.
If Git is used without a metadata storage service, then a reasonable
strategy is to include the variant identifier in the filename
(<a href="#section-2.1">Section 2.1</a>). The default text encoding SHOULD be UTF-8. For other
or different properties, a header file SHOULD be recorded alongside
the Markdown file (<a href="#section-2.2">Section 2.2</a>).
If a metadata storage service is used with Git, then use a convention
that is most analogous to the service. For example, the "metastore"
project emulates extended attributes (xattrs) of a POSIX-like system,
so whatever "xattr" methodology is developed would be usable with
metastore and Git.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Registration Templates for Common Markdown Syntaxes</span>
The purpose of this section is to register certain syntaxes in the
"Markdown Variants" registry [<a href="./rfc7763" title=""The text/markdown Media Type"">RFC7763</a>] because they illustrate
particularly interesting use cases or are broadly applicable to the
Internet community; thus, these syntaxes would benefit from the level
of review associated with publication as IETF documents.
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. MultiMarkdown</span>
Identifier: MultiMarkdown
Name: MultiMarkdown
Description:
MultiMarkdown (MMD) is a superset of "Original". It adds multiple
syntax features (tables, footnotes, and citations, to name a few)
and is intended to output to various formats. Additionally, it
builds in "smart" typography for various languages (proper left-
and right-sided quotes, for example).
<span class="grey">Leonard Informational [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
Additional Parameters:
options: String with zero or more of the following tokens
delimited by whitespace (WSP):
"memoir" / "beamer"
"full" / "snippet"
"process-html"
"random-footnote-identifiers"
"accept"
"reject"
"nosmart"
"nonotes"
"nolabels"
"nomask"
The meanings of these tokens are defined in the
MultiMarkdown documentation.
References:
<<a href="http://fletcher.github.io/MultiMarkdown-4/syntax">http://fletcher.github.io/MultiMarkdown-4/syntax</a>>
Contact Information:
(individual) Fletcher T. Penney <fletcher@fletcherpenney.net>
<<a href="http://fletcherpenney.net/multimarkdown/">http://fletcherpenney.net/multimarkdown/</a>>
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a>. GitHub Flavored Markdown</span>
Identifier: GFM
Name: GitHub Flavored Markdown
Description:
"Original" with the following differences:
1. Multiple underscores in words
2. URL (URI) autolinking
3. Strikethrough
4. Fenced code blocks
5. Syntax highlighting
6. Tables (- for rows; | for columns; : for alignment)
7. Only some HTML allowed; sanitization is integral to the format
References:
<<a href="https://help.github.com/articles/github-flavored-markdown/">https://help.github.com/articles/github-flavored-markdown/</a>>
<<a href="https://github.com/github/markup/tree/master#html-sanitization">https://github.com/github/markup/tree/master#html-sanitization</a>>
Contact Information:
(corporate) GitHub, Inc. <<a href="https://github.com/contact">https://github.com/contact</a>>
<span class="grey">Leonard Informational [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a>. Pandoc</span>
Identifier: pandoc
Name: Pandoc
Description:
Markdown is designed to be easy to write and to read: the content
should be publishable as-is, as plain text, without looking like
it has been marked up with tags or formatting instructions. Yet
whereas "Original" has HTML generation in mind, pandoc is designed
for multiple output formats. Thus, while pandoc allows the
embedding of raw HTML, it discourages it, and provides other, non-
HTMLish ways of representing important document elements like
definition lists, tables, mathematics, and footnotes.
Additional Parameters:
extensions: String with an optional starting syntax token,
followed by a "+" and "-" delimited list of extension
tokens. "+" preceding an extension token turns the
extension on; "-" turns the extension off. The
starting syntax tokens are "markdown",
"markdown_strict", "markdown_phpextra", and
"markdown_github". If no starting syntax token is
given, "markdown" is assumed. The extension tokens
include:
Extensions to turn off (on by default):
escaped_line_breaks
blank_before_header
header_attributes
auto_identifiers
implicit_header_references
blank_before_blockquote
fenced_code_blocks
fenced_code_attributes
line_blocks
fancy_lists
startnum
definition_lists
example_lists
table_captions
simple_tables
multiline_tables
grid_tables
pipe_tables
pandoc_title_block
<span class="grey">Leonard Informational [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
yaml_metadata_block
all_symbols_escapable
intraword_underscores
strikeout
superscript
subscript
inline_code_attributes
tex_math_dollars
raw_html
markdown_in_html_blocks
native_divs
native_spans
raw_tex
latex_macros
implicit_figures
footnotes
inline_notes
citations
Extensions to turn on (off by default):
lists_without_preceding_blankline
hard_line_breaks
ignore_line_breaks
tex_math_single_backslash
tex_match_double_backslash
markdown_attribute
mmd_title_block
abbreviations
autolink_bare_uris
ascii_identifiers
link_attributes
mmd_header_identifiers
compact_definition_lists
Fragment Identifiers:
Pandoc defines fragment identifiers using the <id> in the
{#<id> .class ...} production (PHP Markdown Extra attribute
block). This syntax works for Header Identifiers and Code Block
Identifiers.
References:
<<a href="http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown">http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown</a>>
Contact Information:
(individual) Prof. John MacFarlane <jgm@berkeley.edu>
<<a href="http://johnmacfarlane.net/">http://johnmacfarlane.net/</a>>
<span class="grey">Leonard Informational [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-3.4" href="#section-3.4">3.4</a>. Fountain (Fountain.io)</span>
Identifier: Fountain
Name: Fountain
Description:
Fountain is a simple markup syntax for writing, editing, and
sharing screenplays in plain, human-readable text. Fountain
allows you to work on your screenplay anywhere, on any computer or
tablet, using any software that edits text files.
Fragment Identifiers:
See <<a href="http://fountain.io/syntax#section-titlepage">http://fountain.io/syntax#section-titlepage</a>> and
<<a href="http://fountain.io/syntax#section-sections">http://fountain.io/syntax#section-sections</a>>. In the following
fragment identifiers, the <key> and <sec*> productions MUST have
"/" characters percent-encoded.
#/ Title Page (acts as metadata).
#/<key> Title Page; <key> is the key string.
#<sec1> *("/" <secn>)
Section or subsection. The <sec1>..<secn> productions are
the text of the Section line, with whitespace trimmed from
both ends. Subsections (sections with multiple # characters
at the beginning of the line in the source) are addressed
hierarchically by preceding the subsection with higher-order
sections. If the section hierarchy "skips", e.g., # to ###,
use a blank section name, e.g.,
#Section/ACT%20I//PATIO%20SCENE.
References:
<<a href="http://fountain.io/syntax">http://fountain.io/syntax</a>>
Contact Information:
(individual) Stu Maschwitz <<a href="http://prolost.com/">http://prolost.com/</a>>
(individual) John August <<a href="http://johnaugust.com/">http://johnaugust.com/</a>>
<span class="h3"><a class="selflink" id="section-3.5" href="#section-3.5">3.5</a>. CommonMark</span>
Identifier: CommonMark
Name: CommonMark
Description:
CommonMark is a standard, unambiguous syntax specification for
Markdown, along with a suite of comprehensive tests to validate
<span class="grey">Leonard Informational [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
Markdown implementations against this specification. The
maintainers believe that CommonMark is necessary, even essential,
for the future of Markdown.
Compared to "Original", CommonMark is much longer and in a few
instances contradicts "Original" based on seasoned experience.
Although CommonMark specifically does not mandate any particular
encoding for the input content, CommonMark draws in more of
Unicode, UTF-8, and HTML (including HTML5) than "Original".
This registration always refers to the latest version or an
unspecified version (receiver's choice). Version 0.13 of the
CommonMark specification was released 2014-12-10.
References:
<<a href="http://spec.commonmark.org/">http://spec.commonmark.org/</a>>
Contact Information:
(individual) John MacFarlane <jgm@berkeley.edu>
(individual) David Greenspan <david@meteor.com>
(individual) Vicent Marti <vicent@github.com>
(individual) Neil Williams <neil@reddit.com>
(individual) Benjamin Dumke-von der Ehe <ben@stackexchange.com>
(individual) Jeff Atwood <jatwood@codinghorror.com>
<span class="h3"><a class="selflink" id="section-3.6" href="#section-3.6">3.6</a>. kramdown-rfc2629 (Markdown for RFCs)</span>
Identifier: kramdown-rfc2629
Name: Markdown for RFCs
Description:
kramdown is a markdown parser by Thomas Leitner; it has a number
of backends for generating HTML, LaTeX, and Markdown again.
kramdown-rfc2629 is an additional backend to that: It allows the
generation of XML2RFC XML markup (originally known as markup that
is <a href="./rfc2629">RFC 2629</a> compliant, now documented in <a href="./rfc7749">RFC 7749</a>).
References:
<<a href="https://github.com/cabo/kramdown-rfc2629">https://github.com/cabo/kramdown-rfc2629</a>>
Contact Information:
(individual) Carsten Bormann <cabo@tzi.org>
<span class="grey">Leonard Informational [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-3.7" href="#section-3.7">3.7</a>. <a href="./rfc7328">rfc7328</a> (Pandoc2rfc)</span>
Identifier: <a href="./rfc7328">rfc7328</a>
Name: Pandoc2rfc
Description:
Pandoc2rfc allows authors to write in "pandoc" that is then
transformed to XML and given to xml2rfc. The conversions are, in
a way, amusing, as we start off with (almost) plain text, use
elaborate XML, and end up with plain text again.
References:
<a href="./rfc7328">RFC 7328</a>
<<a href="https://github.com/miekg/pandoc2rfc">https://github.com/miekg/pandoc2rfc</a>>
Contact Information:
(individual) R. (Miek) Gieben <miek@google.com>
<span class="h3"><a class="selflink" id="section-3.8" href="#section-3.8">3.8</a>. PHP Markdown Extra</span>
Identifier: Extra
Name: Markdown Extra
Description:
Markdown Extra is an extension to PHP Markdown implementing some
features currently not available with the plain Markdown syntax.
Markdown Extra is available as a separate parser class in PHP
Markdown Lib. Other implementations include Maruku (Ruby) and Python
Markdown. Markdown Extra is supported in several content management
systems, including Drupal, TYPO3, and MediaWiki.
Fragment Identifiers:
Markdown Extra defines fragment identifiers using the <id> in the
{#<id> .class ...} production (attribute block). This syntax works
for headers, fenced code blocks, links, and images.
References:
<<a href="https://michelf.ca/projects/php-markdown/extra/">https://michelf.ca/projects/php-markdown/extra/</a>>
Contact Information:
(individual) Michel Fortin <michel.fortin@michelf.ca>
<span class="grey">Leonard Informational [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Examples for Common Markdown Syntaxes</span>
This section provides examples of the variants in <a href="#section-3">Section 3</a>.
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. MultiMarkdown</span>
Title: Example of MultiMarkdown
Keywords: IETF, example, footnotes
# MultiMarkdown Example #
MultiMarkdown supports several cool features, as well as
several output formats:
* HTML
* PDF
* OpenDocument
* OPML
* LaTeX
## Footnotes ##
Footnotes are described in the
MultiMarkdown Syntax Guide.[^somesamplefootnote]
[^somesamplefootnote]: Here is the text of the footnote itself.
Figure 1: MultiMarkdown Example
<span class="grey">Leonard Informational [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a>. GitHub-Flavored Markdown</span>
# Start Out #
GFM is like regular Markdown with a few extra features. For example,
http://www.example.com/ will get auto-linked. ~~This is strike-through
text, demarked by the double tildes.~~
```
function test() {
return "notice this feature?");
}
```
# Table Alignments #
| Left | Center | Right |
|:--------- |:-------:| ------:|
| cats | Paxton | $1600 |
| dogs | Ruff | $30 |
| zebras | Stripes | $20900 |
Figure 2: GitHub Flavored Markdown Example
<span class="grey">Leonard Informational [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a>. Pandoc</span>
% Pandoc User's Guide
% John MacFarlane
% August 30, 2014
Synopsis {#syn}
========
pandoc [*options*] [*input-file*]...
Description {#desc}
===========
Pandoc is a [Haskell] library for converting from one markup format to
another, and a command-line tool that uses this library.
#### Extension: `header_attributes` #### {#ext-header-attributes}
Headers can be assigned attributes using this syntax at the end of the
line containing the header text:
{#identifier .class .class key=value key=value}
Thus, for example, the following headers will all be assigned the
identifier `foo`:
# My header {#foo}
## My header ## {#foo}
My other header {#foo}
---------------
Figure 3: Pandoc Example
<span class="grey">Leonard Informational [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-4.4" href="#section-4.4">4.4</a>. Fountain (Fountain.io)</span>
INT. BOXCAR - MOVING - DAY
?AGENT MORTIMER lies bleeding in the corner. The car ROCKS gently.
Mortimer pulls out his cell phone and dials.
MORTIMER?
Come on. Pick up.
CUT TO:?
ext. hotel bar - day?
A fiercely gorgeous brunette sips the last of something from a
rocks glass. This is REBECCA.
Behind her, a dark FIGURE approaches. She seems not to notice.
REBECCA?(to Bartender)
Rittenhouse, neat.
FIGURE (O.S.) ^
Ritenhouse, neat.
She turns to find the source of the voice.
FIGURE
Excellent choice.
Before she can reply, her phone RINGS.?
> INTERCUT WITH:?
.THE BOXCAR
Where MORTIMER is just barely holding on to life.
Figure 4: Fountain Example
<span class="grey">Leonard Informational [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-4.5" href="#section-4.5">4.5</a>. CommonMark</span>
CommonMark is like Markdown.
Here are some entity names that you can use with CommonMark: `&nbsp;
&amp; &copy; &AElig; &Dcaron; &frac34; &HilbertSpace; &DifferentialD;
&ClockwiseContourIntegral;`
You can see more at [the CommonMark website](<a href="http://commonmark.org/">http://commonmark.org/</a>
"CommonMark").
- foo
***
- bar
Tildes can be used for fenced code blocks:
~~~
<
>
~~~
Figure 5: CommonMark Example
<span class="grey">Leonard Informational [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-4.6" href="#section-4.6">4.6</a>. kramdown-rfc2629 (Markdown for RFCs)</span>
---
title: STUN/TURN using PHP in Despair
abbrev: STuPiD-excerpt
docname: <a href="./draft-hartke-xmpp-stupid-excerpt-00">draft-hartke-xmpp-stupid-excerpt-00</a>
date: 2009-07-05
category: info
ipr: trust200902
area: General
workgroup: XMPP Working Group
keyword: Internet-Draft
stand_alone: yes
pi: [toc, sortrefs, symrefs]
author:
-
ins: K. Hartke
name: Klaus Hartke
email: example@tzi.org
normative:
<a href="./rfc2119">RFC2119</a>:
informative:
<a href="./rfc5389">RFC5389</a>:
STUNT:
target: http://www.example.com/oob
title: STUNT & out-of-band channels
author:
name: Robbie Hanson
ins: R. Hanson
date: 2007-09-17
--- abstract
NAT (Network Address Translator) Traversal may require TURN
(Traversal Using Relays around NAT) functionality in certain
cases that are not unlikely to occur. There is little
incentive to deploy TURN servers, except by those who need
them&#x2014;who may not be in a position to deploy a new protocol
on an Internet-connected node, in particular not one with
deployment requirements as high as those of TURN.
--- middle
<span class="grey">Leonard Informational [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
Introduction {#problems}
============
"STUN/TURN using PHP in Despair" is a highly deployable protocol for
obtaining TURN-like functionality, while also providing the most
important function of STUN {{<a href="./rfc5389">RFC5389</a>}}.
The Need for Standardization {#need}
----------------------------
Having one standard form of STuPiD service instead of one specific to
each kind of client also creates an incentive for optimized
implementations.
~~~~~~~~~~
STuPiD ```````````````````````````````,
Script <----------------------------. ,
| ,
^ , | ,
| , | ,
(1) | , | , (3)
POST | , | , GET
| , | ,
| v | v
Peer A -----------------------> Peer B
(2)
out-of-band
Notification
~~~~~~~~~~
{: #figops title="STuPiD Protocol Operation"}
Terminology {#Terminology}
-----------
In this document, the key words "MUST", "MUST NOT", "REQUIRED",
"SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",
and "OPTIONAL" are to be interpreted as described in <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>
{{<a href="./rfc2119">RFC2119</a>}} and indicate requirement levels for compliant STuPiD
implementations.
--- back
Sample Implementation {#impl}
=====================
~~~~~~~~~~
<span class="grey">Leonard Informational [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Content-Type: application/octet-stream");
?>
~~~~~~~~~~
{: #figimpl title="STuPiD Sample Implementation"}
Figure 6: Markdown for RFCs Example
<span class="grey">Leonard Informational [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h3"><a class="selflink" id="section-4.7" href="#section-4.7">4.7</a>. <a href="./rfc7328">rfc7328</a> (Pandoc2rfc)</span>
Pandoc2rfc expects multiple files as input. The following figure is
example of "middle.mkd".
# Introduction
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc subcompact="no"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
This document presents a technique for using Pandoc syntax as a source
format for documents in the Internet-Drafts (I-Ds) and Request
for Comments (RFC) series.
This version is adapted to work with `xml2rfc` version 2.x.
Pandoc is an "almost plain text" format and therefore particularly
well suited for editing RFC-like documents.
> Note: this document is typeset in Pandoc.
> NB: this is mostly text to test Pandoc2rfc, the canonical
> documentation is [<a href="./rfc7328">RFC 7328</a>][p2r].
[p2r]: <a href="http://www.rfc-editor.org/info/rfc7328">http://www.rfc-editor.org/info/rfc7328</a>
# Pandoc to RFC
> Pandoc2rfc -- designed to do the right thing, until it doesn't.
When writing [](#<a href="./rfc4641">RFC4641</a>) we directly wrote the
XML. Needless to say it was tedious even though the XML of
[xml2rfc](<a href="http://xml2rfc.ietf.org/">http://xml2rfc.ietf.org/</a>) is very "light".
The [latest version of xml2rfc version 2 can be found
here](<a href="http://pypi.python.org/pypi/xml2rfc/">http://pypi.python.org/pypi/xml2rfc/</a>).
Figure 7: Pandoc2rfc Example (middle.mkd)
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. IANA Considerations</span>
IANA has registered the syntaxes specified in <a href="#section-3">Section 3</a> in the
"Markdown Variants" registry.
<span class="grey">Leonard Informational [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Security Considerations</span>
See the respective syntax descriptions and output media type
registrations for their respective security considerations.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. References</span>
<span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a>. Normative References</span>
[<a id="ref-MARKDOWN">MARKDOWN</a>] Gruber, J., "Daring Fireball: Markdown", December 2004,
<<a href="http://daringfireball.net/projects/markdown/">http://daringfireball.net/projects/markdown/</a>>.
[<a id="ref-MDSYNTAX">MDSYNTAX</a>] Gruber, J., "Daring Fireball: Markdown Syntax
Documentation",
<<a href="http://daringfireball.net/projects/markdown/syntax">http://daringfireball.net/projects/markdown/syntax</a>>.
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>,
DOI 10.17487/RFC2119, March 1997,
<<a href="http://www.rfc-editor.org/info/rfc2119">http://www.rfc-editor.org/info/rfc2119</a>>.
[<a id="ref-RFC5322">RFC5322</a>] Resnick, P., Ed., "Internet Message Format", <a href="./rfc5322">RFC 5322</a>,
DOI 10.17487/RFC5322, October 2008,
<<a href="http://www.rfc-editor.org/info/rfc5322">http://www.rfc-editor.org/info/rfc5322</a>>.
[<a id="ref-RFC6657">RFC6657</a>] Melnikov, A. and J. Reschke, "Update to MIME regarding
"charset" Parameter Handling in Textual Media Types",
<a href="./rfc6657">RFC 6657</a>, DOI 10.17487/RFC6657, July 2012,
<<a href="http://www.rfc-editor.org/info/rfc6657">http://www.rfc-editor.org/info/rfc6657</a>>.
[<a id="ref-RFC7763">RFC7763</a>] Leonard, S., "The text/markdown Media Type", <a href="./rfc7763">RFC 7763</a>,
DOI 10.17487/RFC7763, March 2016,
<<a href="http://www.rfc-editor.org/info/rfc7763">http://www.rfc-editor.org/info/rfc7763</a>>.
<span class="h3"><a class="selflink" id="section-7.2" href="#section-7.2">7.2</a>. Informative References</span>
[<a id="ref-UNICODE">UNICODE</a>] The Unicode Consortium, "The Unicode Standard, Version
8.0", (Mountain View, CA: The Unicode Consortium, 2015.
ISBN 978-1-936213-10-8),
<<a href="http://www.unicode.org/versions/Unicode8.0.0/">http://www.unicode.org/versions/Unicode8.0.0/</a>>.
[<a id="ref-HUMANE">HUMANE</a>] Atwood, J., "Is HTML a Humane Markup Language?", May 2008,
<<a href="http://blog.codinghorror.com/is-html-a-humane-markup-language/">http://blog.codinghorror.com/</a>
<a href="http://blog.codinghorror.com/is-html-a-humane-markup-language/">is-html-a-humane-markup-language/</a>>.
[<a id="ref-DIN2MD">DIN2MD</a>] Gruber, J., "Dive Into Markdown", March 2004,
<<a href="http://daringfireball.net/2004/03/dive_into_markdown">http://daringfireball.net/2004/03/dive_into_markdown</a>>.
<span class="grey">Leonard Informational [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
[<a id="ref-MD102b8">MD102b8</a>] Gruber, J., "Subject: [ANN] Markdown.pl 1.0.2b8", message
to the markdown-discuss mailing list, 9 May 2007,
<<a href="http://six.pairlist.net/pipermail/markdown-discuss/2007-May/000615.html">http://six.pairlist.net/pipermail/markdown-discuss/</a>
<a href="http://six.pairlist.net/pipermail/markdown-discuss/2007-May/000615.html">2007-May/000615.html</a>>,
<<a href="http://daringfireball.net/projects/downloads/Markdown_1.0.2b8.tbz">http://daringfireball.net/projects/downloads/</a>
<a href="http://daringfireball.net/projects/downloads/Markdown_1.0.2b8.tbz">Markdown_1.0.2b8.tbz</a>>.
[<a id="ref-CATPICS">CATPICS</a>] Gruber, J. and M. Arment, "The Talk Show: Ep. 88: 'Cat
Pictures' (Side 1)", July 2014,
<<a href="http://daringfireball.net/thetalkshow/2014/07/19/ep-088">http://daringfireball.net/thetalkshow/2014/07/19/ep-088</a>>.
[<a id="ref-INETMEME">INETMEME</a>] Solon, O., "Richard Dawkins on the internet's hijacking of
the word 'meme'", June 2013,
<<a href="http://www.wired.co.uk/news/archive/2013-06/20/richard-dawkins-memes">http://www.wired.co.uk/news/archive/2013-06/20/</a>
<a href="http://www.wired.co.uk/news/archive/2013-06/20/richard-dawkins-memes">richard-dawkins-memes</a>>,
<<a href="http://www.webcitation.org/6HzDGE9Go">http://www.webcitation.org/6HzDGE9Go</a>>.
[<a id="ref-MULTIMD">MULTIMD</a>] Penney, F., "MultiMarkdown",
<<a href="http://fletcherpenney.net/multimarkdown/">http://fletcherpenney.net/multimarkdown/</a>>.
[<a id="ref-PANDOC">PANDOC</a>] MacFarlane, J., "Pandoc",
<<a href="http://johnmacfarlane.net/pandoc/">http://johnmacfarlane.net/pandoc/</a>>.
[<a id="ref-RAILFROG">RAILFROG</a>] Railfrog Team, "Railfrog", April 2009,
<<a href="http://railfrog.com/">http://railfrog.com/</a>>.
[<a id="ref-RFC793">RFC793</a>] Postel, J., "Transmission Control Protocol", STD 7,
<a href="./rfc793">RFC 793</a>, DOI 10.17487/RFC0793, September 1981,
<<a href="http://www.rfc-editor.org/info/rfc793">http://www.rfc-editor.org/info/rfc793</a>>.
[<a id="ref-RFC6533">RFC6533</a>] Hansen, T., Ed., Newman, C., and A. Melnikov,
"Internationalized Delivery Status and Disposition
Notifications", <a href="./rfc6533">RFC 6533</a>, DOI 10.17487/RFC6533, February
2012, <<a href="http://www.rfc-editor.org/info/rfc6533">http://www.rfc-editor.org/info/rfc6533</a>>.
[<a id="ref-RFC6838">RFC6838</a>] Freed, N., Klensin, J., and T. Hansen, "Media Type
Specifications and Registration Procedures", <a href="https://www.rfc-editor.org/bcp/bcp13">BCP 13</a>,
<a href="./rfc6838">RFC 6838</a>, DOI 10.17487/RFC6838, January 2013,
<<a href="http://www.rfc-editor.org/info/rfc6838">http://www.rfc-editor.org/info/rfc6838</a>>.
[<a id="ref-XML1.0-5">XML1.0-5</a>] Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and
F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth
Edition)", W3C Recommendation REC-xml-20081126, November
2008, <<a href="http://www.w3.org/TR/2008/REC-xml-20081126">http://www.w3.org/TR/2008/REC-xml-20081126</a>>.
<span class="grey">Leonard Informational [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc7764">RFC 7764</a> Guidance on Markdown and text/markdown March 2016</span>
[<a id="ref-OCCASION">OCCASION</a>] Shieber, S., "Switching to Markdown for scholarly article
production", August 2014,
<<a href="http://blogs.law.harvard.edu/pamphlet/2014/08/29/switching-to-markdown-for-scholarly-article-production/">http://blogs.law.harvard.edu/pamphlet/2014/08/29/</a>
<a href="http://blogs.law.harvard.edu/pamphlet/2014/08/29/switching-to-markdown-for-scholarly-article-production/">switching-to-markdown-for-scholarly-article-production/</a>>.
[<a id="ref-FOUNTAIN">FOUNTAIN</a>] Maschwitz, S. and J. August, "Fountain | A markup language
for screenwriting.", <<a href="http://fountain.io/">http://fountain.io/</a>>.
[<a id="ref-MATHDOWN">MATHDOWN</a>] Cherniavsky-Paskin, B., "math in markdown",
<<a href="https://github.com/cben/mathdown/wiki/math-in-markdown">https://github.com/cben/mathdown/wiki/math-in-markdown</a>>.
[<a id="ref-SVN">SVN</a>] Apache Subversion, December 2015,
<<a href="https://subversion.apache.org/">https://subversion.apache.org/</a>>.
[<a id="ref-GIT">GIT</a>] Git, <<a href="http://git-scm.com/">http://git-scm.com/</a>>.
Author's Address
Sean Leonard
Penango, Inc.
5900 Wilshire Boulevard
21st Floor
Los Angeles, CA 90036
United States
EMail: dev+ietf@seantek.com
URI: <a href="http://www.penango.com/">http://www.penango.com/</a>
Leonard Informational [Page 28]
</pre>
|