forked from Konata9/jsdoc-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
添加了minami模板;升级了模块;修改了example的例子以及增加了输出的文档模板
- Loading branch information
Showing
46 changed files
with
16,871 additions
and
1,914 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,41 @@ | ||
# jsdoc-vue | ||
[![Build Status](https://travis-ci.org/QingWei-Li/jsdoc-vue.svg?branch=master)](https://travis-ci.org/QingWei-Li/jsdoc-vue) | ||
[![npm](https://img.shields.io/npm/v/jsdoc-vue.svg)](https://www.npmjs.com/package/jsdoc-vue) | ||
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) | ||
|
||
> A jsdoc plugin that parses *.vue files. | ||
## Installation | ||
```shell | ||
yarn add jsdoc-vue vue-template-compiler --dev | ||
# npm i jsdoc-vue vue-template-compiler -D | ||
利用 jsdoc 自动生成 .vue 文件的文档。 | ||
### 修改点 | ||
1. 使用了`jsdoc`字典,可以使用`jsdoc`自带的标签来进行编写 | ||
2. 生成文档采用了[minami](https://github.com/Nijikokun/minami)模板 | ||
3. 升级了 vue-template-complier 和 jsdoc 模块 | ||
|
||
## 安装 | ||
``` | ||
[email protected]:Konata9/jsdoc-vue.git | ||
npm install | ||
``` | ||
|
||
## Usage | ||
[Configuring JSDoc with conf.json](http://usejsdoc.org/about-configuring-jsdoc.html) | ||
```json | ||
{ | ||
"plugins": ["node_modules/jsdoc-vue"], | ||
"source": { | ||
"includePattern": "\\.(vue|js)$" | ||
} | ||
} | ||
## 使用方法 | ||
jsdoc 参数可以参照官方文档 [Command-line arguments to JSDoc](http://usejsdoc.org/about-commandline.html) | ||
|
||
**如果没有在全局安装 jsdoc 请手动指定 jsdoc 所在的目录** | ||
``` | ||
jsdoc -c ./conf.js -r | ||
or | ||
## Test | ||
```shell | ||
npm test | ||
./node_modules/jsdoc -c ./config.js -r | ||
``` | ||
**全局的配置可以参考[`config.js`](./conf.js)文件** | ||
更多jsdoc配置文件的语法请参照官网[Configuring JSDoc with a configuration file](http://usejsdoc.org/about-configuring-jsdoc.html) | ||
|
||
## 使用模板 | ||
[minami](https://github.com/Nijikokun/minami) | ||
|
||
## 生成文档样式 | ||
请下载项目后,查看`example/doc/index.html`文件 | ||
|
||
## License | ||
WTFPL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* jsdoc-vue 配置文件 | ||
*/ | ||
module.exports = { | ||
"tags": { | ||
"allowUnknownTags": true, | ||
// 指定所用词典 | ||
"dictionaries": [ | ||
"jsdoc" | ||
] | ||
}, | ||
// 查找文件的深度 需要用 -r 参数 | ||
"recurseDepth": 10, | ||
"source": { | ||
"include": [ | ||
// 需要编译的文件路径 使用时请替换 | ||
"./example" | ||
], | ||
"includePattern": ".+\\.(vue)$", | ||
"excludePattern": "(^|\\/|\\\\)_" | ||
}, | ||
// 使用插件 | ||
"plugins": [ | ||
// 插件路径 | ||
"./jsdoc-vue" | ||
], | ||
"templates": { | ||
"cleverLinks": false, | ||
"monospaceLinks": true, | ||
"useLongnameInNav": false, | ||
"showInheritedInNav": true | ||
}, | ||
"opts": { | ||
// 文档输出路径 | ||
"destination": "./example/doc", | ||
"encoding": "utf8", | ||
"private": true, | ||
"recurse": true, | ||
// 使用模板 minami | ||
"template": "./node_modules/minami" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,48 @@ | ||
<template> | ||
<label> | ||
<input :disabled="disabled" type="text" v-model="checkbox"> | ||
<slot><slot> | ||
<slot> | ||
<slot> | ||
</label> | ||
</template> | ||
|
||
<script> | ||
/** | ||
* A simple checkbox component. | ||
* @module components/basic/checkbox | ||
* @param {number} [disabled=false] - Disabled component | ||
* @param {string[]} model - Required, need two way | ||
* 一个简单的Vue插件 | ||
* @module checkbox | ||
*/ | ||
export default { | ||
name: 'checkbox', | ||
name: "checkbox", | ||
/** | ||
* Props 接受父组件的传值 | ||
* @prop {Array} model 必传参数 | ||
* @prop {Boolen} disabled 控制显示 | ||
*/ | ||
props: { | ||
model: { | ||
type: Array, | ||
required: true, | ||
twoWay: true | ||
}, | ||
disabled: Boolean | ||
}, | ||
/** | ||
* Components 包含子组件 | ||
* @prop {Component} component 子组件1说明 | ||
*/ | ||
components: {}, | ||
methods: { | ||
/** | ||
* @function showMsg | ||
* @param {String} msg 需要打印的消息 | ||
*/ | ||
showMsg: function(msg) { | ||
console.log(msg); | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="css" scoped> | ||
</style> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<title>checkbox.vue - Documentation</title> | ||
|
||
<script src="scripts/prettify/prettify.js"></script> | ||
<script src="scripts/prettify/lang-css.js"></script> | ||
<!--[if lt IE 9]> | ||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> | ||
<![endif]--> | ||
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> | ||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> | ||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> | ||
</head> | ||
<body> | ||
|
||
<input type="checkbox" id="nav-trigger" class="nav-trigger" /> | ||
<label for="nav-trigger" class="navicon-button x"> | ||
<div class="navicon"></div> | ||
</label> | ||
|
||
<label for="nav-trigger" class="overlay"></label> | ||
|
||
<nav> | ||
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Modules</li><li class="nav-heading"><span class="nav-item-type type-module">M</span><span class="nav-item-name"><a href="module-checkbox.html">checkbox</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="module-checkbox.html#~showMsg">showMsg</a></span></li> | ||
</nav> | ||
|
||
<div id="main"> | ||
|
||
<h1 class="page-title">checkbox.vue</h1> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<section> | ||
<article> | ||
<pre class="prettyprint source linenums"><code><template> | ||
<label> | ||
<input :disabled="disabled" type="text" v-model="checkbox"> | ||
<slot> | ||
<slot> | ||
</label> | ||
</template> | ||
|
||
<script> | ||
/** | ||
* 一个简单的Vue插件 | ||
* @module checkbox | ||
*/ | ||
export default { | ||
name: "checkbox", | ||
/** | ||
* Props 接受父组件的传值 | ||
* @prop {Array} model 必传参数 | ||
* @prop {Boolen} disabled 控制显示 | ||
*/ | ||
props: { | ||
model: { | ||
type: Array, | ||
required: true, | ||
twoWay: true | ||
}, | ||
disabled: Boolean | ||
}, | ||
/** | ||
* Components 包含子组件 | ||
* @prop {Component} component 子组件1说明 | ||
*/ | ||
components: {}, | ||
methods: { | ||
/** | ||
* @function showMsg | ||
* @param {String} msg 需要打印的消息 | ||
*/ | ||
showMsg: function(msg) { | ||
console.log(msg); | ||
} | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="css" scoped> | ||
|
||
</style></code></pre> | ||
</article> | ||
</section> | ||
|
||
|
||
|
||
|
||
</div> | ||
|
||
<br class="clear"> | ||
|
||
<footer> | ||
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Jan 09 2018 16:28:31 GMT+0800 (中国标准时间) using the Minami theme. | ||
</footer> | ||
|
||
<script>prettyPrint();</script> | ||
<script src="scripts/linenumber.js"></script> | ||
</body> | ||
</html> |
Binary file not shown.
Oops, something went wrong.