@@ -3,24 +3,19 @@ JSDoc for VueJS
33
44[ ![ npm version] ( https://badge.fury.io/js/jsdoc-vuejs.svg )] ( https://badge.fury.io/js/jsdoc-vuejs )
55[ ![ Build Status] ( https://travis-ci.org/Kocal/jsdoc-vuejs.svg?branch=master )] ( https://travis-ci.org/Kocal/jsdoc-vuejs )
6- [ ![ Coverage Status ] ( https://coveralls .io/repos/github/ Kocal/jsdoc-vuejs/badge.svg?branch=master )] ( https://coveralls .io/github /Kocal/jsdoc-vuejs?branch=master )
6+ [ ![ codecov ] ( https://codecov .io/gh/ Kocal/jsdoc-vuejs/branch/master/graph/ badge.svg )] ( https://codecov .io/gh /Kocal/jsdoc-vuejs )
77
8- > A wobbly JSDoc plugin for listing props, data, computed data, and methods from * .vue files.
9-
10- > WARNING: Actually, it's only working with the default JSDoc template.
11-
12- ## [ Demo] ( https://kocal.github.io/jsdoc-vuejs-demo-docs/ )
8+ > A JSDoc plugin for listing props, data, computed data, and methods from * .vue files.
139
1410## Installation
1511
1612``` bash
17- $ yarn add jsdoc-vuejs -D
18- # $ npm i jsdoc-vuejs -D
13+ $ npm install --save-dev jsdoc-vuejs
1914```
2015
2116## Usage
2217
23- Update your JSDoc configuration
18+ Your should update your JSDoc configuration to enable JSDoc-VueJS:
2419
2520``` json
2621{
@@ -29,47 +24,112 @@ Update your JSDoc configuration
2924 ],
3025 "source" : {
3126 "includePattern" : " \\ .(vue|js)$"
32- },
33- "jsdoc-vuejs" : {}
27+ }
3428}
3529```
3630
37- Update your .vue files:
31+ Update your .vue files with one of the following tags:
32+
33+ - ` @vue-prop `
34+ - ` @vue-data `
35+ - ` @vue-computed `
36+
37+ All of those tags work the same way than [ ` @param ` tag] ( http://usejsdoc.org/tags-param.html ) .
3838
3939``` vue
4040<template>
41- <div>Foo </div>
41+ <div>Hello world! </div>
4242</template>
4343
4444<script>
4545 /**
46- * Add the @vue tag here
47- * @vue
46+ * @vue-prop {Number} initialCounter - Initial counter's value
47+ * @vue-prop {Number} [step=1] - Step
48+ * @vue-data {Number} counter - Current counter's value
49+ * @vue-computed {String} message
4850 */
4951 export default {
52+ props: {
53+ initialCounter: {
54+ type: Number,
55+ required: true,
56+ },
57+ step: {
58+ type: Number,
59+ default: 1,
60+ },
61+ },
5062 data () {
51- return {}
63+ return {
64+ counter: 0,
65+ }
66+ },
67+ computed: {
68+ message() {
69+ return `Current value is ${this.counter}`;
70+ }
5271 }
5372 }
5473</script>
5574```
5675
57- ## Tests
76+ ## Supported templates
77+
78+ The rendering engine has been rewritten in v2, it can supports every JSDoc templates that exists.
79+
80+ Actually, it supports 4 templates:
81+ - Default
82+ - [ Docstrap] ( https://github.com/docstrap/docstrap )
83+ - [ Minami] ( https://github.com/nijikokun/minami )
84+ - [ Tui] ( https://github.com/nhnent/tui.jsdoc-template )
85+
86+ If you use a template that is not supported, it will use the default one as a fallback.
87+
88+ Feel free to open an issue/pull request if your template is not supported!
89+
90+ ### Default
91+
92+ ![ ] ( ./screenshots/renderers/default.png )
93+
94+ ### [ Docstrap] ( https://github.com/docstrap/docstrap )
95+
96+ ![ ] ( ./screenshots/renderers/docstrap.png )
5897
59- Before running tests, you should generate a JSDoc documentation inside ` example ` folder:
98+ ### [ Minami] ( https://github.com/nijikokun/minami )
99+
100+ ![ ] ( ./screenshots/renderers/minami.png )
101+
102+ ### [ Tui] ( https://github.com/nhnent/tui.jsdoc-template )
103+
104+ ![ ] ( ./screenshots/renderers/tui.png )
105+
106+ ## Testing
107+
108+ ### Unit
109+
110+ ``` bash
111+ $ yarn test
112+ ```
113+
114+ ### E2E
115+
116+ Before running integration tests with [ Cypress] ( https://cypress.io ) ,
117+ you should generate documentation with all renderers:
60118
61119``` bash
62120$ cd example
63- $ yarn && yarn docs
64- # $ npm install && npm run docs
65- $ $ cd ..
121+ $ yarn
122+ $ yarn docs
123+ $ yarn docs:docstrap
124+ $ yarn docs:minami
125+ $ yarn docs:tui
126+ $ cd ..
66127```
67128
68- Then run:
129+ And then run Cypress :
69130
70131``` bash
71- $ yarn test
72- # $ npm test
132+ $ yarn cypress run
73133```
74134
75135## License
0 commit comments