New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vitepress-for-component

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vitepress-for-component

dumi like documentation tool

latest
Source
npmnpm
Version
0.17.1
Version published
Maintainers
1
Created
Source

vitepress-for-component

npm npm

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

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

详细文档.

快速开始

  • 使用脚手架create-vlib
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

Keywords

documentation

FAQs

Package last updated on 11 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts