Proposal: Add options to use pre-processed content with `beforeEach` function
- 主要语言
- JavaScript
- 星标
- 31.5k
- 派生
- 5.8k
- 平均合并
- 9 天 8 小时
- 30 天内合并 PR
- 2
描述
## Feature request
#### What problem does this feature solve?
For plugins, we have to do some pre-processing tasks, for example, we always need to ignore the code blocks, then start the processing of our plugins.
If this function not provided by docsify itself officially, then each plugin need to handle it by themselves, for users who want included many plugins, those pre-processing tasks will be executed repeatedly, which will affect the performance for loading pages.
#### What does the proposed API look like?
Haven't yet considered welly, but might can consider adding something like `afterEachXXX` for each stage of processing the markdown content, like `afterEachCodeHandled`.
I hope it should be a “new feature”, rather than a “break change”.
#### How should this be implemented in your opinion?
Haven't yet considered welly, waiting for project members to discuss this proposal, since docsify does not handle the render stages by itself other than using Marked.
#### Are you willing to work on this yourself?
Might will have some time to do this, but need helps and advices.
贡献指南
调研方向
先查看 docsify 的渲染阶段及其与 Marked 的集成,然后与项目维护者讨论拟议的生命周期,因为 issue 没有指定 API 或实现位置。完成标准应包括:一个经过协商且不引入破坏性变更的预处理钩子、已记录的行为,以及涵盖插件处理顺序和预处理内容复用的测试。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- tooling
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100