欢迎关注WX公众号:【程序员管小亮】
最近碰到了一篇文章——【Python - 100天从新手到大师】正则表达式30分钟入门教程,想在其中加上目录,但是在网上看没有啥正确的方法,试了一下都是胡说,要不就是改版了,要不就是瞎写的,很气恼,就琢磨了一种方法,试了一下很好用。
首先对你的目录中的内容进行标题设置,讲道理,这个你得知道吧。
如果你是在不知道,行,就在写博客的makedown编辑器的这个位置。
设置成三级标题就好,大小比较合适,当然,设置成其他的级别也是可以的。
设置之后就会有标题存在,如下图的红色方框。
然后在你文章的开头部分设置一个放置目录的区域,如下面红色方框所示。
打上如下的一行字,小括号里面的红色的加粗字部分就是你想要的目录名字,是可以随意设置(比如,我这里就是设置成目录两个字),而其他的——@
、[toc]
、()
这三个部分不能改变,这样就成功了。
@[toc](你想要的目录名字)