egoist / vmark

Convert markdown to Vue component.
MIT License
162 stars 11 forks source link

【请教】vmark 解析 markdown 的增强 #9

Closed dear-lizhihua closed 6 years ago

dear-lizhihua commented 6 years ago

看了下 vmark 使用的是 marked3 进行解析,和其他的 markdown 文档解析工具类似。

像 webpack 和 vue 的文档都是在头部携带信息的,因为有时候将文档转换为组件后,有很大的情况是获取文档标题、对文档排序、提取文档信息。不知是否能够实现这样的功能。 https://raw.githubusercontent.com/webpack-china/webpack.js.org/cn/src/content/api/cli.md https://raw.githubusercontent.com/vuejs/vuejs.org/master/src/v2/api/index.md

egoist commented 6 years ago

不清楚你想要什么功能

dear-lizhihua commented 6 years ago

就是类似 https://github.com/webpack/webpack.js.org/pull/1839/files 这样(这个示例是 React 的),能够将 header 信息转为 Vue 组件中的数据对象。

egoist commented 6 years ago

也许可以加个选项把 front-matter 里所有数据插入到组件的 data 里。