vscode自动打开markdown preview enhanced_vscode中markdown文件自动自增长目录

本文介绍了如何在VSCode中使用Markdown Preview Enhanced插件,包括安装步骤和自定义CSS样式,以实现Markdown文件的自动目录生成和预览功能。
摘要由CSDN通过智能技术生成

vs code 是一款轻量级文档编辑工具, 常用来编写代码和md文档.

1.显示效果

06db2494aabae6b8d6928eb68a9692ba.png

2.安装步骤

第1步: 安装Markdown Preview Enhanced插件

在vs code的商店中, 搜索 Markdown Preview Enhanced, 然后点击安装即可

bfa4614b20ba1a17dfdd5ff369d63044.png

第2步: 修改插件的默认CSS样式文件

文件名称: katex.min.css

文件路径:

C:甥敳獲自己用户名.vscodeextensionsshd101wyy.markdown-preview-enhanced-0.5.3ode_modules@shd101wyymumedependencieskatex

CSS文件内容

 /** initialize css counter */.markdown-preview {    counter-reset: h1;}h1 {    counter-reset: h2;}h2 {    counter-reset: h3;}h3 {    counter-reset: h4;}h4 {    counter-reset: h5}h5 {    counter-reset: h6}/** put counter result into headings */.markdown-preview h1:before {    counter-increment: h1;    content: counter(h1) ". "}.markdown-preview h2:before {    counter-increment: h2;    content: counter(h1) "." counter(h2) ". "}/** override the default style for focused headings */.markdown-preview h3:before,h3.md-focus.md-heading:before {    counter-increment: h3;    content: counter(h1) "." counter(h2) "." counter(h3) ". "}.markdown-preview h4:before,h4.md-focus.md-heading:before {    counter-increment: h4;    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". "}.markdown-preview h5:before,h5.md-focus.md-heading:before {    counter-increment: h5;    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "}.markdown-preview h6:before,h6.md-focus.md-heading:before {    counter-increment: h6;    content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) "."}/** override the default style for focused headings */.markdown-preview>h3.md-focus:before,.markdown-preview>h4.md-focus:before,.markdown-preview>h5.md-focus:before,.markdown-preview>h6.md-focus:before,h3.md-focus:before,h4.md-focus:before,h5.md-focus:before,h6.md-focus:before {    color: inherit;    border: inherit;    border-radius: inherit;    position: inherit;    left: initial;    float: none;    top: initial;    font-size: inherit;    padding-left: inherit;    padding-right: inherit;    vertical-align: inherit;    font-weight: inherit;    line-height: inherit;}

第3步: 使用插件预览

在vs Code中创建一个MD文件如下图, 然后点击右上角的预览按钮.

03e1daa543904405b54cd65f3e5f0f7f.png
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值