Markdown 标记语言及飞出国论坛

平时大家习惯使用word办公,写文档。word是十分强大和通用的,但word也有很多让人头疼的地方。

必须安装word处理软件(体积很庞大,理论上还要付费才能使用),生成的文件体积大(比纯文本大很多),不方便交换、发布,并且不方便通过计算机技术来处理,程序员编程序从来不用word。

Markdown 是众多标记语言之一,大家熟悉的标记语言可能是 html 网页,也有非计算机人员或许也听说过xml或json。

所有标记语言的共同特点是都是文本文件,可以通过任何文本文件来打开。同时所有标记语言都是人可以查看并且计算机可以处理的。

markdown语言之所以越来越流行是因为他太简单,简单的让人几乎感觉不到他的存在,但却可以方便的解决我们日常文档中的80%的问题。是的,还有20%问题必须借助类似word这样强大的工具来处理,但我们日常生活中注音面对的就是这80%,写日记,写帖子,写博客,写随笔,做记录,markdown已经足够用。

markdown 可以方便的书写,然后可以在任何支持markdown格式的程序里使用,例如可以在stackoverflow,github,discourse,ghost,等,越来越多的平台都在天然支持markdown格式,你需要了解它。

下面简单看看markdown格式是个什么东西

作为标记语言,通过一定的标记字符按特定要求就可以表示特殊的格式,标记语言的核心内容就是表示word文档里的那些特殊格式,例如:** 可以加黑,- 可以创建列表,[]() 可以创建链接,> 可以创建类似email回复时的引用。—— 可以创建横线。当然还可以潜入图片,潜入代码(高亮代码)。

另外一些高级功能,需要结合markdown和网页里的css等技术共同实现,例如变颜色,字体调大小,背景颜色。

还有一些功能需要额外扩展,例如 表格,数学公式。等等。普通用户在论坛里可以尽量避免使用这些。

markdown 功能只有word功能的不到1%,但已经解决了80%的问题,已经比较适合沟通交流使用,我们发微博,发qq,发微信也不需要什么格式。markdown对类似飞出国这样的论坛足够了。discourse本事有预览功能,和下面图片表示的类似,用惯了,不用预览也一样。

为了以后发帖方便大家下载个功能多一点的免费编辑器吧: http://notepad-plus-plus.org/

mac 下的markdown编辑器也很多,包括免费对 Mou 。

当然任何文本编辑器都可以打开,markdown文件可以直接命名为 txt 文件,也可以用标准的md后缀,或者干脆用 markdown 后缀。

还有一些在线编辑器,不仅可以编辑而且可以帮助我们快速了解markdown这个轻巧的标记语言。例如 http://dillinger.iohttps://stackedit.io/http://markable.in/

下面通过 Dillinger 提供的例子来展示markdown标记与具体的显示格式之间的关联,很简单,使用几次就能熟练掌握了。掌握了就离不开了。

# Dillinger

Dillinger is a cloud-enabled, mobile-ready, offline-storage, AngularJS powered HTML5 Markdown editor.

  - Type some Markdown on the left
  - See HTML in the right
  - Magic

Markdown is a lightweight markup language based on the formatting conventions that people naturally use in email.  As [John Gruber] writes on the [Markdown site] [1]:

> The overriding design goal for Markdown's
> formatting syntax is to make it as readable
> as possible. The 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 instructions.

This text you see here is *actually* written in Markdown! To get a feel for Markdown's syntax, type some text into the left window and watch the results in the right.

### Version
3.0.2

### Tech

Dillinger uses a number of open source projects to work properly:

* [AngularJS] - HTML enhanced for web apps!
* [Ace Editor] - awesome web-based text editor
* [Marked] - a super fast port of Markdown to JavaScript
* [Twitter Bootstrap] - great UI boilerplate for modern web apps
* [node.js] - evented I/O for the backend
* [Express] - fast node.js network app framework [@tjholowaychuk]
* [Gulp] - the streaming build system
* [keymaster.js] - awesome keyboard handler lib by [@thomasfuchs]
* [jQuery] - duh

### Plugins

Dillinger is currently extended with the following plugins

* Dropbox
* Github
* Google Drive
* OneDrive

Readmes, how to use them in your own application can be found here:

* [plugins/dropbox/README.md](https://github.com/joemccann/dillinger/tree/master/plugins/dropbox/README.md)
* [plugins/github/README.md](https://github.com/joemccann/dillinger/tree/master/plugins/github/README.md)
* [plugins/googledrive/README.md](https://github.com/joemccann/dillinger/tree/master/plugins/googledrive/README.md)
* [plugins/onedrive/README.md](https://github.com/joemccann/dillinger/tree/master/plugins/onedrive/README.md)

### Development

Want to contribute? Great!

Dillinger uses Gulp + Webpack for fast developing.
Make a change in your file and instantanously see your updates!

Open your favorite Terminal and run these commands.

### Todo's

 - Write Tests
 - Rethink Github Save
 - Add Code Comments
 - Add Night Mode

License
----

MIT


**Free Software, Hell Yeah!**

[john gruber]:http://daringfireball.net/
[@thomasfuchs]:http://twitter.com/thomasfuchs
[1]:http://daringfireball.net/projects/markdown/
[marked]:https://github.com/chjj/marked
[Ace Editor]:http://ace.ajax.org
[node.js]:http://nodejs.org
[Twitter Bootstrap]:http://twitter.github.com/bootstrap/
[keymaster.js]:https://github.com/madrobby/keymaster
[jQuery]:http://jquery.com
[@tjholowaychuk]:http://twitter.com/tjholowaychuk
[express]:http://expressjs.com
[AngularJS]:http://angularjs.org
[Gulp]:http://gulpjs.com

上面的纯文本在discourse及支持markdown的应用里将会显示为下面样子:

Dillinger

Dillinger is a cloud-enabled, mobile-ready, offline-storage, AngularJS powered HTML5 Markdown editor.

  • Type some Markdown on the left
  • See HTML in the right
  • Magic

Markdown is a lightweight markup language based on the formatting conventions that people naturally use in email. As John Gruber writes on the [Markdown site] 1:

The overriding design goal for Markdown’s
formatting syntax is to make it as readable
as possible. The 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 instructions.

This text you see here is actually written in Markdown! To get a feel for Markdown’s syntax, type some text into the left window and watch the results in the right.

Version

3.0.2

Tech

Dillinger uses a number of open source projects to work properly:

Installation

You need Gulp installed globally:

$ npm i -g gulp
$ git clone [git-repo-url] dillinger
$ cd dillinger
$ npm i -d
$ mkdir -p public/files/{md,html,pdf}
$ gulp build --prod
$ NODE_ENV=production node app

Plugins

Dillinger is currently extended with the following plugins

  • Dropbox
  • Github
  • Google Drive
  • OneDrive

Readmes, how to use them in your own application can be found here:

Development

Want to contribute? Great!

Dillinger uses Gulp + Webpack for fast developing.
Make a change in your file and instantanously see your updates!

Open your favorite Terminal and run these commands.

First Tab:

$ node app

Second Tab:

$ gulp watch

(optional) Third:

$ karma start

Todo’s

  • Write Tests
  • Rethink Github Save
  • Add Code Comments
  • Add Night Mode

License

MIT

Free Software, Hell Yeah!

通过在txt文件上书写markdown可以转换为常用格式,这个功能使用起来很方便。

markdown 格式也可以参考这里: https://en.support.wordpress.com/markdown-quick-reference/

markdown 语言的特点就是简单,这也是为什么这种语言这么流行的原因。markdown 谁都能很快学会,只要你别恐惧,肯去学。

markdown 的本质就是大家统一用一种标记来标志文档格式,在支持markdown的网站,论坛,工具里就可以显示成有格式的网页了,用 markdown 写格式化文档的优势太多,飞出国整理的大部分内容都基于 markdown 格式,越用越舒服。

学习 markdown 最简单直接的方式就是实践,建议的学习方式是windows客户下载个 markdownpad 编辑器,像使用 word 一样,通过菜单学习基本格式的 markdown 表式方式,熟悉几次就记住了。

另外也有中文的在线 markdown 编辑器,试几次肯定会。