Git Product home page Git Product logo

jsdoc-plugin-react's Introduction

jsdoc-react

jsdoc plugin to add parsed react component information to documentation. Adds a "Components" jsdoc namespace where component prop tables are listed. The comments used to generate the prop and component comments are then ignored for the rest of doc generation to eliminate redundancy.

Uses react-docgen to parse source files for react component and their prop-types.

Adds HTML table containing the prop info for each component parsed. Parses all react components in source files (not just exported ones).

Does not currently implement a jsdoc template. Does not add a new tag.

Inpsired by better-docs creating an @component tag for jsdoc, but it had too many additional features.

Compatability

This branch should work with jsdoc 3 and 4. jsdoc 5+ and react-docgen 6+ use ESM, so the plugin will need to adjust to ESM in another branch.

This main branch uses CommonJS at the time of writing because jsdoc 5 isn't published on npm, so the normal jsdoc user would need a plugin written as cjs.

Limitations

See limitations of react-docgen 5.x

After react-docgen finds your components and their comments, the plugin removes any comment blocks that have the same content as comment on the components (and their props). This is so your documentation shows up in just one location (Namespace Components). If you had more than one comment with the same content, then both will be removed during doc generation.

jsdoc-plugin-react's People

Contributors

charles-goode avatar

Watchers

 avatar

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.