Skip to content
forked from Kocal/jsdoc-vuejs

📖 A JSDoc plugin for documenting .vue files.

License

Notifications You must be signed in to change notification settings

q13/jsdoc-vuejs

 
 

Repository files navigation

JSDoc for VueJS

npm version Build Status (Travis) Build Status (AppVeyor) codecov Codacy Badge

A JSDoc plugin for listing props, data, computed data, and methods from *.vue files.

Installation

$ npm install --save-dev jsdoc-vuejs

Usage

Your should update your JSDoc configuration to enable JSDoc-VueJS:

{
  "plugins": [
    "node_modules/jsdoc-vuejs"
  ],
  "source": {
    "includePattern": "\\.(vue|js)$"
  }
}

Update your .vue files with one of the following tags:

  • @vue-prop
  • @vue-data
  • @vue-computed

All of those tags work the same way than @param tag.

<template>
  <div>Hello world!</div>
</template>

<script>
  /**
   * @vue-prop {Number} initialCounter - Initial counter's value
   * @vue-prop {Number} [step=1] - Step
   * @vue-data {Number} counter - Current counter's value
   * @vue-computed {String} message
   */
  export default {
    props: {
      initialCounter: {
        type: Number,
        required: true,
      },
      step: {
        type: Number,
        default: 1,
      },
    },
    data () {
      return {
        counter: 0,
      }
    },
    computed: {
      message() {
        return `Current value is ${this.counter}`;
      }
    }
  }
</script>

Supported templates

The rendering engine has been rewritten in v2, it can supports every JSDoc templates that exists.

Actually, it supports 4 templates:

If you use a template that is not supported, it will use the default one as a fallback.

Feel free to open an issue/pull request if your template is not supported!

Default

Docstrap

Minami

Tui

Testing

Unit

$ yarn test

E2E

Before running integration tests with Cypress, you should generate documentation with all renderers:

$ cd example
$ yarn
$ yarn docs
$ yarn docs:docstrap
$ yarn docs:minami
$ yarn docs:tui
$ cd ..

And then run Cypress:

$ yarn cypress run

License

MIT.

About

📖 A JSDoc plugin for documenting .vue files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 82.1%
  • HTML 13.5%
  • Vue 4.4%