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

markdown-it-plugin-vue-livedemo

v0.0.11

Published

vue livedemo plugin for markdown-it

Downloads

7

Readme

markdown-it-plugin-vue-livedemo

仅支持 node 环境运行

  • [X] SDK 配置参数
  • [ ] 复制成功后 Toast 提示
  • [X] 打包出 browser.js: browser.ts、index.scss、lz-string、highlight.js(含css) 共同打包
  • [X] 发布时自动上传 browser.js 到开源 CDN, 便于用户直接在 HTML 中引用, 减少每次渲染出来的代码体积

使用方法

Html 文件中需要添加基础依赖: vue、browser-sdk

<!-- vue 2.x -->
<script src="//unpkg.com/[email protected]/dist/vue.js"></script>
<!-- markdown-it-plugin-vue-livedemo browser sdk -->
<script src="//unpkg.com/markdown-it-plugin-vue-livedemo/lib/browser-sdk.js"></script>

编译 Markdown 文件

import MarkdownIt from 'markdown-it';
import MarkdownItPluginVueLiveDemo from 'markdown-it-plugin-vue-livedemo';

const md = MarkdownIt();
md.use(MarkdownItPluginVueLiveDemo);

const result = md.render(`

## Vue LiveDemo 示例

\`\`\`vue
<!-- livedemo:
  {
    "title": "a"
  }
-->

<template>
  <div class="demo-001">
    <div>currentTag: {{ currentTag }}</div>
    <div class="green">tagList: {{ newTag }}</div>
  </div>
</template>

<style>
  .demo-001 {
    color: red;
  }
  .green {
    color: green;
  }
</style>

<script>
  export default {
    data() {
      return {
        currentTag: 'it',
        newTag: 'abc',

        tagList: [
          { id: 'it', name: '科技' },
          { id: 'tec', name: '教育' },
          { id: 'war', name: '战争' },
        ],
      };
    },
  };
</script>

\`\`\`

`);