WordPress:如何使用Markdown撰写文章

I like the Markdown editor whick is widely used (e.g. This site) and very convenient to use.

我喜欢Markdown 编辑器 Whick,它被广泛使用(例如,此站点)并且非常方便使用。

How to add a Markdown editor for WordPress? I tried some plugins and find they have their strengthens and disadvantages. Here are my requirements:

如何为WordPress添加Markdown编辑器? 我尝试了一些插件,发现它们有其优点和缺点。 这是我的要求:

  1. Compatible with my existing posts. They should still display well. I can accept minimum editing when it is need and should be rare case.

    与我现有的帖子兼容。 它们仍应显示良好。 如果需要,我可以接受最少的编辑,这种情况应该很少见。

  2. Editing existing posts should not mess things up. This is a short of some plugins: Wring new posts works well but editin old posts will turn them to a mess.

    编辑现有帖子不应使事情变得混乱。 这是一些插件的不足:拧干新帖子效果很好,但是编辑旧帖子会使它们陷入混乱。

  3. With a good Markdown editor. An editor helps a lot for Markdown esiting, especially for indenting code.

    拥有出色的Markdown编辑器。 编辑器对Markdown的安装有很大帮助,尤其是缩进代码。

I ever tried different solutions/plugins. Finally, I settle with a solution by combining 2 plugins to write/edit posts in Markdown in WordPress:

我曾经尝试过其他解决方案/插件。 最后,我通过结合2个插件在WordPress的Markdown中编写/编辑帖子来解决问题:

PHP的降价 (php Markdown)

for converting posts written in Markdown to HTML during page serving. Markdown code is saved directly in WordPress. This is different from other solutions that converting Markdown code to HTML before saving and *converting HTML code back to Markdown** when editing—this mess previous posts and new posts if you add HTML/CSS/JavaScript that can not be recognized by the plugins. Hence, I choose php Markdown. It needs a little work to install it. But the tutorial from Michel Fortin is very easy to follow.

用于在页面投放期间将以Markdown编写的帖子转换为HTML。 Markdown代码直接保存在WordPress中。 这与其他解决方案不同,其他解决方案是在保存之前将Markdown代码转换为HTML,然后在编辑时将HTML代码转换为Markdown **,如果添加了插件无法识别HTML / CSS / JavaScript,这会使以前的帖子和新帖子变得混乱。 因此,我选择php Markdown。 需要一点工作来安装它。 但是,Michel Fortin的教程非常容易理解。

Link: http://michelf.ca/projects/php-markdown/

链接: http : //michelf.ca/projects/php-markdown/

The rendering on the fly uses too much CPU cycles? This is a cost. But I always use WP Super Cache on WordPress.

动态渲染占用太多CPU周期? 这是成本。 但是我总是在WordPress上使用WP Super Cache 。

Markdown QuickTags (Markdown QuickTags)

for Markdown editing. It is a beautiful and easy to use Markdown editor for WordPress with a set of Markdown buttons. The basic function is editing. Saving the Markdown code of the post in WordPress and use php Markdown to render it when serving the post. Additionally, it can render the Markdown to HTML and HTML to Markdown which, I find, is very useful for editing old posts written in HTML. I like the undo and redo feature much too—we always make mistakes. Especially when rendering HTML to Markdown, we may mess old posts up and the undo feature will save us.

用于Markdown编辑。 带有Markdown按钮集的WordPress Markdown编辑器非常漂亮且易于使用。 基本功能是编辑 。 在WordPress中保存帖子的Markdown代码,并在提供帖子时使用php Markdown渲染它。 此外,它可以将Markdown呈现为HTML,将HTML呈现为Markdown,这对于编辑用HTML编写的旧帖子非常有用。 我也非常喜欢撤消重做功能-我们总是会犯错误。 尤其是在将HTML呈现到Markdown时,我们可能会将旧帖子弄乱,并且撤消功能可以为我们节省时间。

Link: http://wordpress.org/extend/plugins/markdown-quicktags/

链接: http : //wordpress.org/extend/plugins/markdown-quicktags/

Answered by SA.
由SA回答。


Some tools for Markdown:

Markdown的一些工具 :

Markdown syntax: http://daringfireball.net/projects/markdown/syntax

Markdown语法: http : //daringfireball.net/projects/markdown/syntax

Markdownifier: http://heckyesmarkdown.com/

Markdownifier: http : //heckyesmarkdown.com/

翻译自: https://www.systutorials.com/wordpress-how-to-use-markdown-for-writing-posts/

你可能感兴趣的:(java,wordpress,python,markdown,html)