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

vue-juri

v1.0.1

Published

A component for Vue.js to display the demo and usage elegantly.

Downloads

235

Readme

vue-juri

NPM version NPM downloads CircleCI

DEMO

Introduction

Vue-juri is a component for Vue.js that loads a list of Markdown files and uses slots to display the demos and usages elegantly.

The design is inspired by Ant Design! I like the elegant way to display a list of examples.

The name comes from Juri Yukawa in Kokkoku 💃

Install

yarn add vue-juri

CDN: UNPKG | jsDelivr (available as window.Juri)

Usage

<template>
  <juri :doc-list="docList"></juri>
</template>

<script>
import Juri from 'vue-juri'
import basic from 'raw-loader!./docs/basic.md'

export default {
  components: {
    Juri
  },
  data () {
    return {
      docList: [basic]
    }
  }
}
</script>

Guides

What are example docs

Example docs are a list of markdown files that contain the code blocks of the examples' usage. We render the code blocks in the usage part of the demo. For example:

<template>
  <star-rate :value="4"/>
</template>

<script>
import StarRate from 'vue-cute-rate'

export default {
  components: {
    StarRate
  }
}
</script>

Set the examples' custom title and description

You can use following marks in each example markdown file to set custom title and description of it.


---
title: Basic 
desc: The simplest usage.
---

Where to set the docs

The docs were set to a docs directory, and the path of the directory was ./docs/ relatived to .vue file by default.

How to import the markdown files

You need to use raw-loader to import files as a string.

You can use the loader via webpack config or inline. View raw-loader for more details.

via webpack config

webpack.config.js


module.exports = {
 module: {
   rules: [
     {
       test: /\.md/,
       use: 'raw-loader'
     }
   ]
 }
}

In your application

import file from './docs/basic.md'

Inline

In your application

import file from 'raw-loader!./docs/basic.md'

Props

| Property | Description | type | Default | | -------- | ----------- | ---- | ------- | | doc-list | Array of the example markdown files. | array | [] | | expand-all | Whether to expand all usages. | boolean | false | | highlight | Whether to highlight code blocks, you can supply a function to customize this, use prismjs to highlight code by default. | boolean / function | true | | big-demo | Display as a big demo-box which not contains left and right columns. | boolean | false |

Slot

The live demo which you want to display, make sure to use demo-${index} as the slot name, index is the order of the markdown file in doc-list.

Here is a simple example:

<template>
  <div id="app">
    <juri :doc-list="docList">
      <star-rate slot="demo-0" :value="4"/>
    </juri>
  </div>
</template>

<script>
import Juri from 'vue-juri'
import basic from 'raw-loader!./docs/basic.md'
import StarRate from 'vue-cute-rate'

export default {
  components: {
    Juri,
    StarRate
  },
  data () {
    return {
      docList: [basic]
    }
  }
}
</script>

Author

vue-juri © luyilin, released under the MIT License.

minemine.cc · GitHub @luyilin · Twitter @luyilin12