vitepress-plugin-props2table

Parsing interface Show as a table
322 5
Install
npm install vitepress-plugin-props2table
Latest Version:0.1.3
Vue:3
License:ISC
Last Updated:Dec 8, 2022
Links: GitHub  ·  npm
Maintainer: yucccc

vitepress-plugin-props2table

Parsing interface Show as a table.

why?

Writing component documents makes the work cumbersome.
Using this plug-in, you can directly import parameter files to parse the table format you want.

中文 编写组件文档让工作变得繁琐,使用该插件可以直接导入参数文件,从而解析为你想要的表格格式

install

pnpm i vitepress-plugin-props2table

usage

1、add plugin in vite.config.js

import { props2table } from 'vitepress-plugin-props2table'

export default defineConfig({
    plugins: [
        props2table(),
    ],
})

2、add command in markdown

<!-- /path.ts is you file path -->
@props2table(/path.ts)

3、and you will see a table

Output table demo

参数说明类型是否必填可选值默认值
a描述astringtrue默认值是1
b描述b 是一个枚举值a | b | ctrue默认值是a
c描述c是一个外部引用的类型Props2true
e描述e 是一个数组string[]true
fRecord<string, string>true

Get Parse Interface

If you don't want to render it as a table and want to get the parsing results
you can directly use the parseInterface method.

import { parseInterface } from 'vitepress-plugin-props2table'
parseInterface('you code') // return JSON => ParseInterfaceTypes

ParseInterfaceTypes

doc

http://yucccc.com/vitepress-plugin-props2table/

Related Packages

prettier-plugin-vitepress

a prettier plugin to format vue in markdown syntax used in vitepress

11,180 11
vitepress-md-var

Adds editable variables to markdown code blocks

1,601 1
cloudflare-ai-search-sync

Synchronize Markdown files to Cloudflare AI Search automatically.

1,302 0

Version History

Version Released Vue License
0.1.3 ^3.2.39 ISC
0.1.1 ^3.2.39 ISC
0.1.0 ^3.2.39 ISC
0.0.8 ^3.2.39 ISC
0.0.7 ^3.2.39 ISC