Appearance
PostHtml
元信息
- 目标:认识 PostCSS 思路在 HTML 上的延伸——posthtml 及 unified 系列(remark/rehype/retext)如何以解析→AST→插件→序列化的统一管线处理各类标记语言
- 关键概念:PostHtml、后处理器、unified、unist、remark、rehype
- 关联阶段:cp3
- 常见误区:以为预处理只是 CSS 的专利(HTML/Markdown 同样可"解析成 AST 再加工");以为 remark/rehype 是互不相关的工具(同属 unified 生态,共享 unist 语法树规范)
关于html的预处理技术
类似于Postcss,关注于语义结构的转换
- 综述 https://evilmartians.com/chronicles/five-years-of-postcss-state-of-the-union
- 对比 https://www.npmtrends.com/posthtml-parser-vs-rehype-parse
post系统
unifiedjs系列
- https://unifiedjs.com/
- https://github.com/syntax-tree/unist
- remark
- rehype
- retext