0.1.91 • Published 3 years ago

vue-code-info v0.1.91

Weekly downloads
12
License
MIT
Repository
github
Last release
3 years ago

Vue Code Info

npm.io npm.io

node.js vue.js

Display a header to code blocks in markdown for example with color of language and option for file path. It's for guides about plugins or frameworks.

vue-code-info

Documentation

Install it with Yarn or NPM

yarn add -D vue-code-info

OR

npm i vue-code-info --save-dev

Import it, ES6 way, in main.js / app.js file

import VueCodeInfo from 'vue-code-info'

Vue.use(VueCodeInfo)

Usage

Use it in a .vue file

<template>
  <div>
    <vue-code-info ext="js" path="index.js">
      <pre><code>import VueCodeInfo from './lib/vue-code-info.vue'

      export default {
        install(Vue) {
          Vue.component('vue-code-info', VueCodeInfo)
        },
      }</pre></code>
    </vue-code-info>
  </div>
</template>

Use in .md in vuepress or nuxt / content

## Example of code

<vue-code-info ext="js" path="index.js">

```js
import VueCodeInfo from './lib/vue-code-info.vue'

export default {
  install(Vue) {
    Vue.component('vue-code-info', VueCodeInfo)
  },
}

API

PropsTypeDefaultDescribe
extString''Extension of file, display it on header and get correct color if available
pathString''Path of the file, useful if it's guide for a framework
hasMarginBooleantrueTo get margin top and bottom
notReachableBooleanfalseTo apply a layer to prevent user to get code

License

MIT © @ewilan-riviere

0.1.91

3 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago