vitepress-for-component

dumi like documentation tool
3,020 195
Install
npm install vitepress-for-component
Latest Version:0.17.1
Vue:3
License:MIT
Last Updated:Jan 2, 2023
Links: GitHub  ·  npm
Maintainer: dewfall

vitepress-for-component

npm npm

VFC Fork 自VitePress,针对组件开发场景做了一些功能增强和默认样式修改。

可以理解为是一个在 VitePress 的基础上向 dumi 靠拢的工具。

详细文档.

快速开始

yarn create vlib
  • 不使用脚手架

像 vitepress 一样使用即可。

示例站点

Features

1. 内置Demo组件

我们可以在.md文件中这样来引入demo。

<demo src="./demo.vue"
  language="vue"
  title="Demo演示"
  desc="这是一个Demo渲染示例">
</demo>

渲染效果如下:


demo-example

2. 像 dumi 一样的组织文件

在组件编写的场景中,我们觉得 dumi 的文件结构更合适。

示例:

假设我们有这样一个组件库。

VitePress文件结构如下。

docs
├─ index.md
├─ loading
│  └─ index.md
├─ zh
│  ├─ index.md
│  └─ loading
│     └─ index.md
src
├── loading
│ ├── demo
│ │ └── demo.vue
│ └── loading.vue
└── ...

vitepress-for-componnet文件结构如下。

docs
├── index.en-US.md
├── index.zh-CN.md
src
├── loading
│ ├── demo
│ │ └── demo.vue
│ ├── index.en-US.md
│ ├── index.zh-CN.md
│ └── loading.vue
└── ...

我们觉得dumi的组织结构有如下好处:

  • demo.vue 和 loading.md 都放在 src 下面,源码和文档联系感更强。
  • 用后缀.zh-CN来区分 locale,更加有对比度。

3. 更合适的默认样式

如图:


example

Related Packages

@vuepress/plugin-nprogress

nprogress plugin for vuepress

3,258,429 22,716
@vuepress/plugin-active-header-links

active-header-links plugin for vuepress

3,218,918 22,716
@vuepress/theme-default

Default theme for VuePress

3,076,688 22,716
@vuepress/plugin-search

search plugin for vuepress

2,580,346 22,716
@vuepress/plugin-register-components

register-global-components plugin for vuepress

2,557,918 22,716

Version History

Version Released Vue License
0.17.1 ^3.2.20 MIT
0.17.0 ^3.2.20 MIT
0.16.9 ^3.2.20 MIT
0.16.8 ^3.2.20 MIT
0.16.7 ^3.2.20 MIT