Coder Social home page Coder Social logo

jsdoc-vue-component's Introduction

jsdoc-vue-component

A simple plugin for jsdoc (pase vue SFC info to description by AST analysis).

Maybe you will try jsdoc-vuedoc, and you have a better experience。

Installation

npm i jsdoc-vue-component -D

Related

Use:

This plugin just extract the component's info into markdown format, and instert it into the @vuedoc's position.

Not affect other jsdoc features of the code.

  1. add @vuedoc tag to comment.
  2. add @exports componentName tag to comment.

just add @vuedoc tag, @exports tag, to the to document in you vue SFC.

/**
 * sidebar component description
 * @vuedoc
 * @exports component/SideBar
 */
export default {}

如何使用jsdoc?

  • 安装jsdoc: npm i jsdoc -D
  • 安装模板:npm i sherry-docstrap -D, 原来的docstrap有点小bug还未修复,所以自己暂时发布一个。
  • 在项目目录下建了配置文件:下面有示例,适当修改。
  • 在pacakge.json 里添加一个script: "jsdoc": "rm -rf public/jsdoc && node_modules/.bin/jsdoc -c jsdoc.json", public/jsdoc为发布位置,适当修改
  • 生成文档: npm run jsdoc

Options

  • log: true,
  • tag: 'vuedoc'

jsdoc.json

{
  "plugins": [
    "node_modules/jsdoc-vue-component",
    "plugins/markdown",
    "plugins/summarize"
  ],
  "jsdoc-vue-component": {
    "log": true
  },
  "markdown": {
    "tags": ["author", "classdesc", "description", "param", "property", "returns", "see", "throws", "vue"]
  },
  "recurseDepth": 10,
  "source": {
    "include": ["fe/src"],
    "includePattern": ".+\\.(js|vue)$",
    "excludePattern": "(^|\\/|\\\\)_"
  },
  "sourceType": "module",
  "tags": {
    "allowUnknownTags": true,
    "dictionaries": ["jsdoc", "closure"]
  },
  "templates": {
    "logoFile": "",
    "cleverLinks": false,
    "monospaceLinks": false,
    "dateFormat": "ddd MMM Do YYYY",
    "outputSourceFiles": true,
    "outputSourcePath": true,
    "systemName": "DocStrap",
    "footer": "",
    "copyright": "DocStrap Copyright © 2012-2015 The contributors to the JSDoc3 and DocStrap projects.",
    "navType": "vertical",
    "theme": "cosmo",
    "linenums": true,
    "collapseSymbols": false,
    "inverseNav": true,
    "protocol": "html://",
    "methodHeadingReturns": false
  },
  "markdown": {
    "parser": "gfm",
    "hardwrap": true
  },
  "opts": {
    "template": "node_modules/sherry-docstrap/template",
    "encoding": "utf8",
    "destination": "./public/jsdoc/",
    "recurse": true,
    "readme": "README.md",
    "tutorials": "./docs/"
  }
}

效果

效果.

jsdoc-vue-component's People

Contributors

ccqgithub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jsdoc-vue-component's Issues

vue组件的名称解析有误

// props: {}, object
if (item.value.type == 'ObjectExpression') {
item.value.properties.forEach(prop => {
// test: Type
if (prop.value.type == 'Identifier') {
props.push({
name: prop.key.name, // prop.key.name为undefined,改为prop.key.value即可
type: prop.value.name
});
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.