Front-matter的规则
郝伟 2020/12/04
在Markdown中, 可以使用front matter 进行一些内容定义,比如在本文中头部的定义如下所示:
---
title: "Front-matter的规则"
numbersections: true
author: Dr.Hao
pandoc_args: ["--toc", "--toc-depth=4"]
toc:
depth_from: 1
depth_to: 4
ordered: false
html:
embed_local_images: true
embed_svg: true
offline: false
export_on_save:
pandoc: true
html: true
---
在Markdown头部的这些内容称之为front-matter,可以通过大量的参数,描述页面布局等内容。
配置项主要包括以下内容:
顺便提下,关于toc,除了使用front-matter定义,我们可以利用以下语法自动生成标题列表。
<!-- @import "[TOC]" {cmd="toc" depthFrom=2 depthTo=3 orderedList=false} -->
如果插入图片需要调整大小可以使用源后的html语法:
<img src="http://static.runoob.com/images/runoob-logo.png" align="middle" width="30%" height="10%" vspace=20px>
效果如下所示:

align: [top, bottom, middle, left, right]
border pixels 不推荐使用。定义图像周围的边框。
height, width 尺寸 可以是px也可以是%
hspace pixels 定义图像左侧和右侧的空白。
vspace pixels 定义图像顶部和底部的空白。
ismap URL 将图像定义为服务器端图像映射。
小技巧:
<br> 进行换行<table> 标签来建立表格