Text::Markdown::Discount
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

233 lines
8.0 KiB

15 years ago
  1. Download
  2. --------
  3. [Markdown 1.0.1][dl] (18 KB) -- 17 Dec 2004
  4. [dl]: http://daringfireball.net/projects/downloads/Markdown_1.0.1.zip
  5. Introduction
  6. ------------
  7. Markdown is a text-to-HTML conversion tool for web writers. Markdown
  8. allows you to write using an easy-to-read, easy-to-write plain text
  9. format, then convert it to structurally valid XHTML (or HTML).
  10. Thus, "Markdown" is two things: (1) a plain text formatting syntax;
  11. and (2) a software tool, written in Perl, that converts the plain text
  12. formatting to HTML. See the [Syntax][] page for details pertaining to
  13. Markdown's formatting syntax. You can try it out, right now, using the
  14. online [Dingus][].
  15. [syntax]: /projects/markdown/syntax
  16. [dingus]: /projects/markdown/dingus
  17. The overriding design goal for Markdown's formatting syntax is to make
  18. it as readable as possible. The idea is that a Markdown-formatted
  19. document should be publishable as-is, as plain text, without looking
  20. like it's been marked up with tags or formatting instructions. While
  21. Markdown's syntax has been influenced by several existing text-to-HTML
  22. filters, the single biggest source of inspiration for Markdown's
  23. syntax is the format of plain text email.
  24. The best way to get a feel for Markdown's formatting syntax is simply
  25. to look at a Markdown-formatted document. For example, you can view
  26. the Markdown source for the article text on this page here:
  27. <http://daringfireball.net/projects/markdown/index.text>
  28. (You can use this '.text' suffix trick to view the Markdown source for
  29. the content of each of the pages in this section, e.g. the
  30. [Syntax][s_src] and [License][l_src] pages.)
  31. [s_src]: /projects/markdown/syntax.text
  32. [l_src]: /projects/markdown/license.text
  33. Markdown is free software, available under a BSD-style open source
  34. license. See the [License] [pl] page for more information.
  35. [pl]: /projects/markdown/license
  36. Discussion List <a id="discussion-list" />
  37. ---------------
  38. I've set up a public [mailing list for discussion about Markdown] [ml].
  39. Any topic related to Markdown -- both its formatting syntax and
  40. its software -- is fair game for discussion. Anyone who is interested
  41. is welcome to join.
  42. It's my hope that the mailing list will lead to good ideas for future
  43. improvements to Markdown.
  44. [ml]: http://six.pairlist.net/mailman/listinfo/markdown-discuss
  45. Installation and Requirements <a id="install" />
  46. -----------------------------
  47. Markdown requires Perl 5.6.0 or later. Welcome to the 21st Century.
  48. Markdown also requires the standard Perl library module [Digest::MD5]
  49. [md5], which is probably already installed on your server.
  50. [md5]: http://search.cpan.org/dist/Digest-MD5/MD5.pm
  51. ### Movable Type ###
  52. Markdown works with Movable Type version 2.6 or later (including
  53. Movable Type 3.0).
  54. 1. Copy the "Markdown.pl" file into your Movable Type "plugins"
  55. directory. The "plugins" directory should be in the same directory
  56. as "mt.cgi"; if the "plugins" directory doesn't already exist, use
  57. your FTP program to create it. Your installation should look like
  58. this:
  59. (mt home)/plugins/Markdown.pl
  60. 2. Once installed, Markdown will appear as an option in Movable Type's
  61. Text Formatting pop-up menu. This is selectable on a per-post basis:
  62. ![Screenshot of Movable Type 'Text Formatting' Menu][tfmenu]
  63. Markdown translates your posts to HTML when you publish; the posts
  64. themselves are stored in your MT database in Markdown format.
  65. 3. If you also install SmartyPants 1.5 (or later), Markdown will
  66. offer a second text formatting option: "Markdown With
  67. SmartyPants". This option is the same as the regular "Markdown"
  68. formatter, except that it automatically uses SmartyPants to create
  69. typographically correct curly quotes, em-dashes, and ellipses. See
  70. the [SmartyPants web page][sp] for more information.
  71. 4. To make Markdown (or "Markdown With SmartyPants") your default
  72. text formatting option for new posts, go to Weblog Config:
  73. Preferences.
  74. Note that by default, Markdown produces XHTML output. To configure
  75. Markdown to produce HTML 4 output, see "Configuration", below.
  76. [sp]: http://daringfireball.net/projects/smartypants/
  77. ### Blosxom ###
  78. Markdown works with Blosxom version 2.0 or later.
  79. 1. Rename the "Markdown.pl" plug-in to "Markdown" (case is
  80. important). Movable Type requires plug-ins to have a ".pl"
  81. extension; Blosxom forbids it.
  82. 2. Copy the "Markdown" plug-in file to your Blosxom plug-ins folder.
  83. If you're not sure where your Blosxom plug-ins folder is, see the
  84. Blosxom documentation for information.
  85. 3. That's it. The entries in your weblog will now automatically be
  86. processed by Markdown.
  87. 4. If you'd like to apply Markdown formatting only to certain
  88. posts, rather than all of them, Markdown can optionally be used in
  89. conjunction with Blosxom's [Meta][] plug-in. First, install the
  90. Meta plug-in. Next, open the Markdown plug-in file in a text
  91. editor, and set the configuration variable `$g_blosxom_use_meta`
  92. to 1. Then, simply include a "`meta-markup: Markdown`" header line
  93. at the top of each post you compose using Markdown.
  94. [meta]: http://www.blosxom.com/plugins/meta/meta.htm
  95. ### BBEdit ###
  96. Markdown works with BBEdit 6.1 or later on Mac OS X. It also works
  97. with BBEdit 5.1 or later and MacPerl 5.6.1 on Mac OS 8.6 or later. If
  98. you're running Mac OS X 10.2 (Jaguar), you may need to install the
  99. Perl module [Digest::MD5] [md5] from CPAN; Digest::MD5 comes
  100. pre-installed on Mac OS X 10.3 (Panther).
  101. 1. Copy the "Markdown.pl" file to appropriate filters folder in your
  102. "BBEdit Support" folder. On Mac OS X, this should be:
  103. BBEdit Support/Unix Support/Unix Filters/
  104. See the BBEdit documentation for more details on the location of
  105. these folders.
  106. You can rename "Markdown.pl" to whatever you wish.
  107. 2. That's it. To use Markdown, select some text in a BBEdit document,
  108. then choose Markdown from the Filters sub-menu in the "#!" menu, or
  109. the Filters floating palette
  110. Configuration <a id="configuration"></a>
  111. -------------
  112. By default, Markdown produces XHTML output for tags with empty elements.
  113. E.g.:
  114. <br />
  115. Markdown can be configured to produce HTML-style tags; e.g.:
  116. <br>
  117. ### Movable Type ###
  118. You need to use a special `MTMarkdownOptions` container tag in each
  119. Movable Type template where you want HTML 4-style output:
  120. <MTMarkdownOptions output='html4'>
  121. ... put your entry content here ...
  122. </MTMarkdownOptions>
  123. The easiest way to use MTMarkdownOptions is probably to put the
  124. opening tag right after your `<body>` tag, and the closing tag right
  125. before `</body>`.
  126. To suppress Markdown processing in a particular template, i.e. to
  127. publish the raw Markdown-formatted text without translation into
  128. (X)HTML, set the `output` attribute to 'raw':
  129. <MTMarkdownOptions output='raw'>
  130. ... put your entry content here ...
  131. </MTMarkdownOptions>
  132. ### Command-Line ###
  133. Use the `--html4tags` command-line switch to produce HTML output from a
  134. Unix-style command line. E.g.:
  135. % perl Markdown.pl --html4tags foo.text
  136. Type `perldoc Markdown.pl`, or read the POD documentation within the
  137. Markdown.pl source code for more information.
  138. Acknowledgements <a id="acknowledgements" />
  139. ----------------
  140. [Aaron Swartz][] deserves a tremendous amount of credit for helping to
  141. design Markdown's formatting syntax. Markdown is *much* better thanks
  142. to Aaron's ideas, feedback, and testing. Also, Aaron's [html2text][]
  143. is a very handy (and free) utility for turning HTML into
  144. Markdown-formatted plain text.
  145. [Nathaniel Irons][], [Dan Benjamin][], [Daniel Bogan][], and [Jason Perkins][]
  146. also deserve thanks for their feedback.
  147. [Michel Fortin][] has ported Markdown to PHP; it's a splendid port, and highly recommended for anyone looking for a PHP implementation of Markdown.
  148. [Aaron Swartz]: http://www.aaronsw.com/
  149. [Nathaniel Irons]: http://bumppo.net/
  150. [Dan Benjamin]: http://hivelogic.com/
  151. [Daniel Bogan]: http://waferbaby.com/
  152. [Jason Perkins]: http://pressedpants.com/
  153. [Michel Fortin]: http://www.michelf.com/projects/php-markdown/
  154. [html2text]: http://www.aaronsw.com/2002/html2text/
  155. [tfmenu]: /graphics/markdown/mt_textformat_menu.png