[Feature request] A node API to re-render the page from page.content #1309
Replies: 7 comments
-
修改 @mdit-vue/plugin-sfc 的结果的确是一个好的解决办法。
你可以提一个 reproduction,如果你说的是 include 功能,其依赖于 |
Beta Was this translation helpful? Give feedback.
-
改为调用 vuepress 提供的 |
Beta Was this translation helpful? Give feedback.
-
能否在 |
Beta Was this translation helpful? Give feedback.
-
我看了看源码我没看懂你要说什么 |
Beta Was this translation helpful? Give feedback.
-
意思就是能不能在读取完markdown文件后再调用extendsPageOptions,像这样: // resolve page file absolute path and relative path
const { filePath, filePathRelative } = resolvePageFilePath({
app,
options,
})
// read the raw file content according to the absolute file path
const content = await resolvePageFileContent({ filePath, options })
// plugin hook: extendsPageOptions
await app.pluginApi.hooks.extendsPageOptions.process(options, app) |
Beta Was this translation helpful? Give feedback.
-
那这个hook有什么用?你先好好理解一下这个hook的设计目标吧。 |
Beta Was this translation helpful? Give feedback.
-
再读了一遍文档,抱歉是我以前没正确理解 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Clear and concise description of the problem
如题,正在开发的插件需要在
extendsPageOptions
或者extendsPage
阶段注入一个组件,但此时页面已渲染完成,目前尝试可行的只有如下方法才能成功修改内容:顺带一提,不知为何这样会破坏 vuepress-plugin-md-enhance 的 import 功能
Suggested solution
添加对应的node API
Alternative
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions