markdown #10
Replies: 8 comments 34 replies
-
|
写的真叫好,markdown 可惜没有找到 markdown 内自定义CSS样式,不知道是否支持 |
Beta Was this translation helpful? Give feedback.
-
|
我发现一个问题,如果在左下角点了退出登录,退出gothub 退出成功以后,你就再也看不到评论区了。 一直显示加载失败。 然后也没有登录的按钮和办法。 后来实在登录不上,我用服务器的windows登录才进来的。 请谨慎测试,最好用小号 |
Beta Was this translation helpful? Give feedback.
-
|
对于 GitHub 风格的容器,会显示英文,如:NOTE、IMPORTANT 等,虽然我认为还行,但是可能很多人有强迫症就是喜欢中文,那么就可以这么做,在 config.mts 中的 markdown 配置项,将 NOTE 等替换为中文,代码如下: markdown: { // markdown 配置
math: true,
lineNumbers: true, // 行号显示
image: {
// 开启图片懒加载
lazyLoading: true
},
// 组件插入h1标题下
config: (md) => {
// 创建 markdown-it 插件
md.use((md) => {
const defaultRender = md.render
md.render = function (...args) {
const [content, env] = args
const isHomePage = env.path === '/' || env.relativePath === 'index.md' // 判断是否是首页
if (isHomePage) {
return defaultRender.apply(md, args) // 如果是首页,直接渲染内容
}
// 调用原始渲染
let defaultContent = defaultRender.apply(md, args)
// 替换内容
defaultContent = defaultContent.replace(/NOTE/g, '提醒')
.replace(/TIP/g, '建议')
.replace(/IMPORTANT/g, '重要')
.replace(/WARNING/g, '警告')
replace(/CAUTION/g, '注意')
// 返回渲染的内容
return defaultContent
}
})
}
}, |
Beta Was this translation helpful? Give feedback.
-
|
大佬,求救 页面需要插入2个本地视频该怎么办呢? 第二个会出不来这个怎么办呀 |
Beta Was this translation helpful? Give feedback.
-
|
[[toc]] 为什么不显示一级标题呀 |
Beta Was this translation helpful? Give feedback.
-
|
HI,VitePress 中如何使mermaid生效啊,使用vitepress-plugin-mermaid插件无法启动项目, 在Typora和obsidian 中都可以显示正常的流程图。 |
Beta Was this translation helpful? Give feedback.
-
|
奇怪为啥我的标题锚 中英文都不行 非要设置自定义锚点才行, 只有我的是这样的吗? |
Beta Was this translation helpful? Give feedback.
-
|
大佬好!关于表格我遇到一个问题:markdown表格不能合并单元格但是能渲染表格中的公式(我使用的是mathjax插件,vitepress官网推荐的),而使用HTML写表格的话虽然能合并单元格但是不能渲染公式,我今天试了一天,包括更换各种插件都没有搞定,也许是我的配置写不对,大佬可否帮我试一下?我的需求是用HTML写表格并且能用mathjax渲染表格中的公式,谢谢大佬! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
markdown
我的vitpress文档教程
https://vitepress.yiov.top/markdown.html
Beta Was this translation helpful? Give feedback.
All reactions