GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ly-tools/react-docer

BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
src
src
 
 
test
test
 
 
.babelrc
.babelrc
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
.publishrc
.publishrc
 
 
.travis.yml
.travis.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 

Repository files navigation

react-docer

Test coverage Build Status Dependency Status devDependency Status NPM version node License npm download

A tool to parse doc from jsx source file

Installation

$ npm install --save react-docer

Usage

const docer = require('react-docer');
docer(content);
const React = require('react');
import babel from 'babel';
/**
 * class description
 */
class Component extends React.Component {
  /**
   * static prop description
   */
  static someProps = 'qwerty'
  /**
   * constructor description
   */
  constructor() {
    super();
  }
  /**
   * get value
   */
  getValue() {}
  /**
   * set value
   */
  setValue(value) {}
  /**
   * render description
   */
  render() {
    return (
      <div></div>
    );
  }
}

Component.propTypes = {
  /**
   * Description of someProp.
   */
  someProp: React.PropTypes.string
};
Component.displayName = 'Component';
Component.defaultProps = {
  someProp: ''
};

Then the result will be:

{
  "dependencies": [
    "react",
    "babel"
  ],
  "classes": [
    {
      "name": "Component",
      "superClass": "React.Component",
      "description": "class description",
      "methods": [
        {
          "description": "constructor description",
          "name": "constructor",
          "params": []
        },
        {
          "description": "get value",
          "name": "getValue",
          "params": []
        },
        {
          "description": "set value",
          "name": "setValue",
          "params": [
            "value"
          ]
        },
        {
          "description": "render description",
          "name": "render",
          "params": []
        }
      ],
      "properties": [
        {
          "description": "static prop description",
          "name": "someProps",
          "value": "'qwerty'",
          "static": true
        }
      ],
      "propTypes": [
        {
          "name": "someProp",
          "required": false,
          "type": {
            "name": "string"
          },
          "description": "Description of someProp.",
          "defaultValue": "''"
        }
      ],
      "displayName": "Component"
    }
  ]
}

Test

$ npm run test # running unit tests
$ npm run dev # watching files change and building automaticly

License

The MIT License (MIT)

Copyright (c) 2015 ly-tools

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.