antvis / gatsby-theme-antv

⚛️ Polished Gatsby theme for documentation site
https://gatsby-starter-theme-antv.antv.vision/zh
Other
344 stars 57 forks source link

API 部分抽取公共内容,md 自动填充 #203

Closed BBSQQ closed 4 years ago

BBSQQ commented 4 years ago

内网👇:https://yuque.antfin-inc.com/antv/rkzcpd/lwseu8

API md 自动生成

背景描述

现状:AntV 官网目前所有页面都是通过 md 自动生成的,如下图,右侧的层级结构是 md 的 n级标题: image

痛点:一个类库有很多同样的描述,比如折线图、散点图都会有描述绘图元素的 style,那我如果之后需要改这部分内容就需要像下面一样,改几十个 md 文件,这样手动维护成本太高了 image

需求

例子如下: 公共内容 md,以 style  为例

## style
### fill
填充

### stroke 
描边

主体内容 md,以 折线图 为例

## 折线图

### xField
x轴

### yField
y轴

### lineStyle (quote style)
这里可以通过脚本自动添加公共内容文件 style 里的内容
NewByVector commented 4 years ago

image image 遍历当前页面内容ast,遇到自定义的标签(hello)就替换为对应路径md文档的ast。 功能可行,实现起来感觉比较粗鲁