Open H1DDENADM1N opened 3 months ago
Markdown是什么?
谁创造了它?
为什么要使用它?
怎么使用?
谁在用?
尝试一下
Markdown是一种轻量级标记语言,它以纯文本形式(易读、易写、易更改)编写文档,并最终以HTML格式发布。
Markdown也可以理解为将以MARKDOWN语法编写的语言转换成HTML内容的工具。
它由Aaron Swartz和John Gruber共同设计,Aaron Swartz就是那位于去年(2013年1月11日)自杀,有着开挂一般人生经历的程序员。维基百科对他的介绍是:软件工程师、作家、政治组织者、互联网活动家、维基百科人。
他有着足以让你跪拜的人生经历:
天才都有早逝的归途。
如果不算扩展,Markdown的语法绝对简单到让你爱不释手。
Markdown语法主要分为如下几大部分:
标题,段落,区块引用,代码区块,强调,列表,分割线,链接,图片,反斜杠 \
,符号'`'。
两种形式:
1)使用=
和-
标记一级和二级标题。
一级标题
=========
二级标题
---------
效果:
一级标题
=========
二级标题
2)使用#
,可表示1-6级标题。
# 一级标题
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题
效果:
一级标题
二级标题
三级标题
四级标题
五级标题
六级标题
段落的前后要有空行,所谓的空行是指没有文字内容。若想在段内强制换行的方式是使用两个以上空格加上回车(引用中换行省略回车)。
在段落的每行或者只在第一行使用符号>
,还可使用多个嵌套引用,如:
> 区块引用
>> 嵌套引用
效果:
区块引用
嵌套引用
代码区块的建立是在每行加上4个空格或者一个制表符(如同写代码一样)。如
普通段落:
void main()
{
printf("Hello, Markdown.");
}
代码区块:
void main()
{
printf("Hello, Markdown.");
}
注意:需要和普通段落之间存在空行。
在强调内容两侧分别加上*
或者_
,如:
*斜体*,_斜体_
**粗体**,__粗体__
效果:
斜体,斜体
粗体,粗体
使用·
、+
、或-
标记无序列表,如:
-(+*) 第一项 -(+*) 第二项 - (+*)第三项
注意:标记后面最少有一个_空格_或制表符。若不在引用区块中,必须和前方段落之间存在空行。
效果:
- 第一项
- 第二项
- 第三项
有序列表的标记方式是将上述的符号换成数字,并辅以.
,如:
1 . 第一项
2 . 第二项
3 . 第三项
效果:
- 第一项
- 第二项
- 第三项
分割线最常使用就是三个或以上*
,还可以使用-
和_
。
链接可以由两种形式生成:行内式和参考式。
行内式:
[younghz的Markdown库](https:://github.com/younghz/Markdown "Markdown")。
效果:
参考式:
[younghz的Markdown库1][1]
[younghz的Markdown库2][2]
[1]:https:://github.com/younghz/Markdown "Markdown"
[2]:https:://github.com/younghz/Markdown "Markdown"
效果:
注意:上述的[1]:https:://github.com/younghz/Markdown "Markdown"
不出现在区块中。
添加图片的形式和链接相似,只需在链接的基础上前方加一个!
。
\
相当于反转义作用。使符号成为普通符号。
起到标记作用。如:
`ctrl+a`
效果:
ctrl+a
Markdown的使用者:
stackedit
与markdown-here
等非常方便,也不用担心平台受限。当然,最终境界永远都是笔下是语法,心中格式化 :)。
注意:不同的Markdown解释器或工具对相应语法(扩展语法)的解释效果不尽相同,具体可参见工具的使用说明。 虽然有人想出面搞一个所谓的标准化的Markdown,[没想到还惹怒了健在的创始人John Gruber] (http://blog.codinghorror.com/standard-markdown-is-now-common-markdown/ )。
以上基本是所有traditonal markdown的语法。
列表的使用(非traditonal markdown):
用|
表示表格纵向边界,表头和表内容用-
隔开,并可用:
进行对齐设置,两边都有:
则表示居中,若不加:
则默认左对齐。
代码库 | 链接 |
---|---|
MarkDown | https://github.com/younghz/Markdown |
MarkDownCopy | https://github.com/younghz/Markdown |
关于其它扩展语法可参见具体工具的使用说明。
## [Alerts](#alerts)
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
Alerts are a Markdown extension based on the blockquote syntax that you can use to emphasize critical information. On GitHub, they are displayed with distinctive colors and icons to indicate the significance of the content.
Use alerts only when they are crucial for user success and limit them to one or two per article to prevent overloading the reader. Additionally, you should avoid placing alerts consecutively. Alerts cannot be nested within other elements.
To add an alert, use a special blockquote line specifying the alert type, followed by the alert information in a standard blockquote. Five types of alerts are available:
> [!NOTE]
> Useful information that users should know, even when skimming content.
> [!TIP]
> Helpful advice for doing things better or more easily.
> [!IMPORTANT]
> Key information users need to know to achieve their goal.
> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.
> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.
[!NOTE] Useful information that users should know, even when skimming content.
[!TIP] Helpful advice for doing things better or more easily.
[!IMPORTANT] Key information users need to know to achieve their goal.
[!WARNING] Urgent info that needs immediate user attention to avoid problems.
[!CAUTION] Advises about risks or negative outcomes of certain actions.
Gmeek
一个博客框架,超轻量级个人博客模板。完全基于
Github Pages
、Github Issues
和Github Actions
。不需要本地部署,从搭建到写作,只需要18秒,2步搭建好博客,第3步就是写作。安装
【创建仓库】点击通过模板创建仓库,建议仓库名称为
XXX.github.io
,其中XXX
为你的github用户名。【启用Pages】在仓库的
Settings
中Pages->Build and deployment->Source
下面选择Github Actions
。【开始写作】打开一篇issue,开始写作,并且必须添加一个
标签Label
(至少添加一个),再保存issue后会自动创建博客内容,片刻后可通过https://XXX.github.io 访问(可进入Actions页面查看构建进度)。【手动全局生成】这个步骤只有在修改
config.json
文件或者出现奇怪问题的时候,需要执行。提交问题
Issues
后,我会帮忙查看构建流程,定位问题出处。特性
jinja2
对html进行渲染,可通过模板自定义UI主题赞赏
如果本项目对你有帮助,可以用微信赞赏一下作者,让项目有继续更新维护下去的动力,谢谢!
鸣谢
License
请保留页面底部和console界面版权信息,谢谢!