我不是作家,但对于写作工具,我却尝试过很多。

其实最简单的,一个Windows下的记事本也能完成写作。或者其他操作系统的默认文本处理软件,都足以满足大多数人的基本需求。

笨重的,比如用Office的Word软件,也能写出大作。《三体》的作者刘慈欣就是用Word写作的。

这里有个折中的办法,就是使用Markdown写作。其实工具不是最重要的,重要的是灵感和创意。

什么是Markdown ?

Markdown is a lightweight markup language with plain text formatting syntax. It’s designed so that it can be converted to HTML and many other formats using a tool by the same name. Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor. As the initial description of Markdown contained ambiguities and unanswered questions, many implementations and extensions of Markdown appeared over the years to answer these issues.

总的来说,Markdown使用简单的标记语法,极大的方便了文本的格式化。现在很多文本编辑的地方都支持Markdown,比如GitHub,v2ex,图灵社区,博客园等。

Markdown的缺点是:

  • 不同的渲染引擎出来的效果不统一。
  • 较难实现复杂的排版。

不过对于个人写博客,日记来说,这些缺点都可以忽略。Markdown是再合适不过的。

Markdown 语法

Markdown的语法很简单,这里给出基本的语法。(复杂的语法,效果会有更大的不同,因此,尽量使用最基本的语法)。有些语法有多种,但为了简略和表现效果起见,这里只给出一种:)

标题语法:

在行首插入 1 到 6 个 # ,对应到标题 1 到 6 阶,例如:

1
2
3
4
5
6
# H1 标题在这里
## H2 标题在这里
### H3 标题在这里
#### H4 标题在这里
##### H5 标题在这里
###### H6 标题在这里

标题效果

H1 标题在这里

H2 标题在这里

H3 标题在这里

H4 标题在这里

H5 标题在这里
H6 标题在这里

列表语法

1
2
3
4
5
6
7
8
9
10
11
12
无序列表
- 这里是无序列表
- 这里是无序列表
- 这里是无序列表
- 这里是无序列表
- 这里是无序列表
有序列表
1. 这里是有序列表1
2. 这里是有序列表2
3. 这里是有序列表3
4. 这里是有序列表4
5. 这里是有序列表5

列表效果

无序列表

  • 这里是无序列表
  • 这里是无序列表
  • 这里是无序列表
  • 这里是无序列表
  • 这里是无序列表

有序列表

  1. 这里是有序列表1
  2. 这里是有序列表2
  3. 这里是有序列表3
  4. 这里是有序列表4
  5. 这里是有序列表5

引用语法

1
> Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world are the ones who do.

引用效果

Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can’t do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world are the ones who do.

链接语法

1
[天边风的个人网站](https://www.tbfeng.com)

链接效果

天边风的个人网站

图片语法

1
![示例图片](https://wx3.sinaimg.cn/mw690/006MIJAjgy1ffjivzs88qj31kw1kw1kx.jpg)

图片效果

示例图片

代码语法:代码前一行后最后一行使用 ``` 包围

代码效果

1
2
3
4
5
6
7
8
9
10
11
12
13
if ("POST".Equals(request.GetApiMethod(), StringComparison.OrdinalIgnoreCase))
{
if (request is VopMobilePublicUploadRequest<T>)
{
body = webUtils.DoPost(url, filedata, this.charset);
}
else
{
if (!request.GetNeedCert())
body = webUtils.DoPost(url, data, this.charset);
else
body = webUtils.DoPost(url, data, this.charset, VopUtils.GetCert(request.GetCertPath(), request.GetCertPassword()));
}

分割线语法

1
***

分割线效果


转义语法

1
2
\*
\-

转义效果

*

-

强调语法

1
2
*强调1*
**强调2**

强调效果

强调1

强调2