在 WordPress 下如何通过 Markdown 来提高工作效率
WordPress Markdown
![](/data/attachment/album/201609/22/134344im0194foc8mks5a5.jpg)


Markdown 是一种简单的标记语言，旨在帮助你花费更小的代价来格式化纯文本文档。在 WordPress 下你可以使用 HTML 或者可视化编辑器来格式化你的文档，但是使用 markdown 可以让格式化文档变得更加容易，而且你随时可以导出成很多种格式，包括（但不限于）HTML。


WordPress 没有原生的 markdown 的支持，但是，如果你希望的话，在你的网站上有多种插件可以添加这种功能。


在这个教程中，我将会演示如何使用流行的 WP-Markdown 插件为 WordPress 网站添加 markdown 支持。


### 安装


导航到 “Plugins -> Add New”，然后在提供的搜索框中输入 “[wp-markdown](https://wordpress.org/plugins/wp-markdown/)” 就可以直接安装。插件应该会出现在列表中的第一个。单击 “Install Now” 进行安装。


![](/data/attachment/album/201609/22/134404cjd5ovgmokkna54g.png)


### 配置


当你已经安装了这个插件并且激活它之后，导航到 “Settings -> Writing” 并向下滚动，直到 markdown 选项。


你可以启用文章、页面和评论中对于 markdown 的支持。如果你刚刚开始学习 markdown 语法的话，那么你也可以在文章编辑器或者评论的地方启用一个帮助栏，这可以使你更方便一些。


![](/data/attachment/album/201609/22/134503oe050jhvxqv304u0.png)


如果在你的博客文章中包括代码片段的话，那么启用 “Prettify syntax highlighter” 将会让你的代码片段自动语法高亮。


一旦对于你的选择感觉满意的话，那么就单击 “Save Changes” 来保存你的设置吧。


### 使用 Markdown 来写你的文章


当你在自己网站中启用了 markdown 的支持，你就可以立马开始使用了。


通过 “Posts -> Add New” 创建一篇新的文章。你将会注意到默认的可视化及纯文本编辑器已经被 markdown 编辑器所替代。


如果你在配置选项中没有启用 markdown 的帮助栏，你将不会看到 markdown 格式化后的实时预览。然而，只要你的语法是正确的，当你保存或者发布文章的时候，你的 markdown 就会转换成正确的 HTML。


然而，如果你是 markdown 的初学者的话，实时预览这一特征对你会很重要，只需要简单的回到刚才的设置中启用帮助栏选项，你就可以在你的文章底部看到一块漂亮的实时预览区域。另外，你也可以在顶部看到很多按钮，它们将帮助你在文章中快速的插入 markdown 格式。


![](/data/attachment/album/201609/22/134526s4av9fufxlf33nfn.png)


### 结语


正如你所看到的那样，在 WordPress 网站上添加 markdown 支持确实容易，你将只需要花费几分钟的时间就可以了。如果对于 markdown 你全然不知的话，或许你也可以查看我们的 [markdown 备忘录](https://www.maketecheasier.com/productive-with-markdown-cheatsheet/)，它将对于 markdown 语法提供一个全面的参考。




---


via: <https://www.maketecheasier.com/use-markdown-in-wordpress/>


作者：[Ayo Isaiah](https://www.maketecheasier.com/author/ayoisaiah/) 译者：[yangmingming](https://github.com/yangmingming) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![markdown-wordpress-featured-2](https://www.maketecheasier.com/assets/uploads/2016/09/markdown-wordpress-featured-2.jpg)

Markdown is a simple markup language that helps you format your plain text documents with minimal effort. You may be used to formatting your articles using HTML or the Visual Editor in WordPress, but using markdown makes formatting a lot easier, and you can always export it to several formats including (but not limited to) HTML.

WordPress does not come with native markdown support, but there are plugins that can add this functionality to your website if you so desire.

In this tutorial I will demonstrate how to use the popular [WP-Markdown](https://wordpress.org/plugins/wp-markdown/) plugin to add markdown support to a WordPress website.

## Installation

You can install this plugin directly by navigating to “Plugins -> Add New” and entering “wp-markdown” in the search box provided. The plugin should appear as the first option on the list. Click “Install Now” to install it.

## Configuration

Once you have installed the plugin and activated it, navigate to “Settings -> Writing” in the menu and scroll down until you get to the markdown section.

You can enable markdown support in posts, pages and comments. You can also enable a help bar for your post editor or comments which could be handy if you’re just learning the markdown syntax.

If you include code snippets in your blog posts, enabling the “Prettify syntax highlighter” option will automatically provide syntax highlighting for your code snippets.

Once you are satisfied with your selections, click “Save Changes” to save your settings.

## Write your posts with Markdown

Once you have enabled markdown support on your website, you can start using it right away.

Create a new post by going to “Posts -> Add New.” You will notice that the default Visual and Plain Text editors have been replaced by the markdown editor.

If you did not enable the markdown help bar in the configuration options, you will not see a live preview of your formatted markdown. Nonetheless, as long as your syntax is correct, your markdown will be converted to valid HTML when you save or publish the post.

However, if you’re a beginner to markdown and the live preview feature is important to you, simply go back to the settings to enable the help bar option, and you will get a nice live preview area at the bottom of your posts. In addition, you also get some buttons on top that will help you quickly insert markdown syntax into your posts. This could be a potentially amazing setting if people use it. You can adjust the priority of the notification on individual apps. This will let you choose what you see in the notification bar.

## Wrap up

As you can see adding markdown support to a WordPress website is really easy, and it will only take a few minutes of your time. If you are completely new to markdown, you might also check out our [markdown cheatsheet](https://www.maketecheasier.com/cheatsheet/markdown/) which provides a comprehensive reference to the markdown syntax.

Our latest tutorials delivered straight to your inbox