减价

下载

减价1.0.1(KB)18日——2004年12月17日

介绍

减价是网络作家text-to-HTML转换工具Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

Thus, “Markdown” is two things: (1) a plain text formatting syntax; and (2) a software tool, written in Perl, that converts the plain text formatting to HTML看到语法page for details pertaining to Markdown’s formatting syntaxYou can try it out, right now, using the online新玩意儿

The overriding design goal for Markdown’s formatting syntax is to make it as readable as possibleThe idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructionsWhile Markdown’s syntax has been influenced by several existing text-to-HTML filters, the single biggest source of inspiration for Markdown’s syntax is the format of plain text email.

The best way to get a feel for Markdown’s formatting syntax is simply to look at a Markdown-formatted documentFor example, you can view the Markdown source for the article text on this page here:http://www.gazogooz.com/projects/markdown/index.text

(You can use this ‘.text’ suffix trick to view the Markdown source for the content of each of the pages in this section, e.g的语法许可证页面。)

Markdown is free software, available under a BSD-style open source license看到许可证页面获取更多信息。

讨论表

我建立了一个公开的邮件列表讨论减价. Any topic related to Markdown — both its formatting syntax and its software — is fair game for discussionAnyone who is interested is welcome to join.

It’s my hope that the mailing list will lead to good ideas for future improvements to Markdown.

安装和需求

减价需要Perl 5.6.0或更新版本Welcome to the 21st Century. Markdown also requires the standard Perl library module摘要::MD5,可能已经安装在您的服务器上。

活字

Markdown works with Movable Type version 2.6 or later (including Movable Type 3.0).

  1. Copy the “Markdown.pl” file into your Movable Type “plugins” directoryThe “plugins” directory should be in the same directory as “mt.cgi”; if the “plugins” directory doesn’t already exist, use your FTP program to create itYour installation should look like this:

    (mt)/插件/ Markdown.pl
  2. Once installed, Markdown will appear as an option in Movable Type’s Text Formatting pop-up menu这是在每帖的基础上选择:

    截图的活字“文本格式”菜单

    Markdown translates your posts to HTML when you publish; the posts themselves are stored in your MT database in Markdown format.

  3. If you also install SmartyPants 1.5 (or later), Markdown will offer a second text formatting option: “Markdown With SmartyPants”This option is the same as the regular “Markdown” formatter, except that it automatically uses SmartyPants to create typographically correct curly quotes, em-dashes, and ellipsesSee theSmartyPants网页为更多的信息。

  4. To make Markdown (or “Markdown With SmartyPants”) your default text formatting option for new posts, go to Weblog Config: Preferences.

注意,默认情况下,减价生成XHTML输出To configure Markdown to produce HTML 4 output, see “Configuration”, below.

Blosxom

减价处理Blosxom版本2.0或更高版本。

  1. Rename the “Markdown.pl” plug-in to “Markdown” (case is important)Movable Type requires plug-ins to have a “.pl” extension; Blosxom forbids it.

  2. Copy the “Markdown” plug-in file to your Blosxom plug-ins folder. If you’re not sure where your Blosxom plug-ins folder is, see the Blosxom documentation for information.

  3. 就是这样The entries in your weblog will now automatically be processed by Markdown.

  4. If you’d like to apply Markdown formatting only to certain posts, rather than all of them, Markdown can optionally be used in conjunction with Blosxom’s插件First, install the Meta plug-inNext, open the Markdown plug-in file in a text editor, and set the configuration variableg_blosxom_use_meta美元1然后,仅仅包含一个“元标记:减价” header line at the top of each post you compose using Markdown.

BBEdit

减价处理BBEdit在Mac OS X 6.1或更高版本It also works with BBEdit 5.1 or later and MacPerl 5.6.1 on Mac OS 8.6 or laterIf you’re running Mac OS X 10.2 (Jaguar), you may need to install the Perl module摘要::MD5from CPAN; Digest::MD5 comes pre-installed on Mac OS X 10.3 (Panther).

  1. Copy the “Markdown.pl” file to appropriate filters folder in your “BBEdit Support” folder在Mac OS X上,这应该是:

    BBEdit /支持/ Unix支持/ Unix过滤器

    See the BBEdit documentation for more details on the location of these folders.

    You can rename “Markdown.pl” to whatever you wish.

  2. 就是这样To use Markdown, select some text in a BBEdit document, then choose Markdown from the Filters sub-menu in the “#!” menu, or the Filters floating palette

配置

By default, Markdown produces XHTML output for tags with empty elements. E.g.:

< br / >

Markdown can be configured to produce HTML-style tags; e.g.:

< br >

活字

你需要用一个特殊的MTMarkdownOptionscontainer tag in each Movable Type template where you want HTML 4-style output:

<MTMarkdownOptions output='html4'>
    ..put your entry content here ...
</MTMarkdownOptions>

The easiest way to use MTMarkdownOptions is probably to put the opening tag right after your<身体>tag, and the closing tag right before< /身体>

抑制减价处理在一个特定的模板,即to publish the raw Markdown-formatted text without translation into (X)HTML, set the输出属性“生”:

<MTMarkdownOptions output='raw'>
    ..put your entry content here ...
</MTMarkdownOptions>

命令行

使用——html4tagscommand-line switch to produce HTML output from a Unix-style command line例如:

% perl Markdown.pl --html4tags foo.text

类型perldoc Markdown.pl, or read the POD documentation within the Markdown.pl source code for more information.

确认

亚伦斯deserves a tremendous amount of credit for his feedback on the design of Markdown’s formatting syntax减价是better thanks to Aaron’s ideas, feedback, and testing同时,亚伦的html2textis a very handy (and free) utility for turning HTML into Markdown-formatted plain text.

纳撒尼尔·铁,丹便雅悯,丹尼尔出身低微的人,杰森·珀金斯也应该感谢他们的反馈。

米歇尔·福丁has ported Markdown to PHP; it’s a splendid port, and highly recommended for anyone looking for a PHP implementation of Markdown.