npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vuepress-plugin-demo-block-antd

v1.0.0

Published

vuepress2代码实现代码块demo展示, yarn版

Downloads

3

Readme

code-block代码块插件

vuepress-plugin-code-block是一个基于vuepress@next版本的主题插件,他会帮助你再编写组件文档的时候增加vue示例。

目前的示例模板是按照ant-design-vue去实现的,感兴趣的小伙伴可以自定义实现。

目前还在开发阶段,希望大家在使用的过程中出现的bug或者问问题,欢迎提交issue和PR。

安装

在安装次插件之前,请确保您已经安装了vuepress@next版本


npm i -D @yanyu-fe/vuepress-plugin-code-block

yarn add -D @yanyu-fe/vuepress-plugin-code-block

pnpm add -D @yanyu-fe/vuepress-plugin-code-block

使用

.vuepress文件夹下创建一个config.ts文件,配置如下

import { defineUserConfig } from "vuepress";
import { codeBlockPlugin } from "@yanyu-fe/vuepress-plugin-code-block";
export default defineUserConfig({
  title: "文档",
  plugins: [codeBlockPlugin()],
});

注册完成后,我们就可以直接在markdown中使用啦!

编写组件例子

  • 普通vue文件支持

<demo src="./demo/test.vue" title="测试demo" desc="这是一个测试的`demo`"></demo>
  • tsx(jsx)文件支持

目前已经支持了tsx文件


<demo src="./demo/test.tsx" title="测试demo" desc="这是一个测试的`demo`"></demo>

ts文件

显示代码块

引入之后只显示代码块,不需要转换为示例


<demo src="./demo/test.tsx" raw></demo>

<demo src="./demo/test.vue" raw></demo>

ts文件

其他语言使用demo组件的处理方法

目前对于其他的语言如ts/js/html/css等文件进行处理,目前只能转换为代码块显示


<demo src="./demo/test.ts"></demo>

ts文件

demo属性支持

| 参数 | 类型 | 默认值 | 描述 | | ------- | --------- | ------- | ---------------- | | raw | boolean | false | 是否显示源代码块 | | title | string | - | 标题 | | desc | string | - | 描述 | | src | string | - | 示例绝对路径 |

目前规划的属性较少,有小伙伴可以参考自定义

演示

演示站点目前还在筹划中。。。