0.1.3 • Published 1 year ago

vitepress-plugin-props2table v0.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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

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/