📖 A JSDoc plugin for documenting .vue files.
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__tests__ feat(parser): plain JavaScript files are now being parsed (#128) Oct 20, 2018
cypress fix(parser): JavaScript files are not all interpreted as a Vue compon… Nov 17, 2018
example fix(parser): JavaScript files are not all interpreted as a Vue compon… Nov 17, 2018
lib fix(parser): JavaScript files are not all interpreted as a Vue compon… Nov 17, 2018
screenshots/templates chore: update screenshots (#107) Aug 15, 2018
.appveyor.yml chore: AppVeyor integration (#115) Aug 26, 2018
.eslintrc.json chore: replace ESLint Standard with AirBnb (#62) Jun 17, 2018
.gitignore doc: rewrite README for v2 (#70) Jun 18, 2018
.travis.yml ci(travis): remove "sudo: false" (#138) Nov 19, 2018
CHANGELOG.md chore(release): 2.3.1 Nov 17, 2018
LICENSE chore: switch license from GPL3 to MIT (#69) Jun 17, 2018
README.md chore: AppVeyor integration (#115) Aug 26, 2018
UPGRADE.md refactor: rewrite tags and rendering system (#59) Jun 17, 2018
config.js feat(renderers): use a templating system with EJS (#106) Aug 15, 2018
cypress.json chore(cypress): configure video, screenshots, and cypress dashboard (#… Aug 11, 2018
index.js fix(parser): JavaScript files are not all interpreted as a Vue compon… Nov 17, 2018
jest.config.js test: add tests for "renderer" module (#110) Aug 18, 2018
package.json chore(release): 2.3.1 Nov 17, 2018
yarn.lock build(deps-dev): bump eslint-plugin-cypress from 2.1.0 to 2.1.2 (#134) Nov 12, 2018

README.md

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.