FormidableLabs/ecology

Name: ecology

Owner: Formidable

Description: Documentation generator for collections of react components.

Created: 2015-10-01 03:55:19.0

Updated: 2018-01-02 20:17:09.0

Pushed: 2017-09-21 20:39:16.0

Homepage: null

Size: 16201

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Travis Status

Ecology

Description

Ecology allows you to write markdown documentation for React components that includes interactive playground sections and auto-generated propType specifications.

See the demo app for a complete example:

ns the demo component documentation dev-server
d open it in your default browser.

m run dev && npm run open-demo
Component PropType Documentation
  1. Your component should be created using React.createClass() or class Foo extends React.Component.

  2. Your component should define propTypes in the createClass object literal or as a static property of the class.

  3. Your component may define default props as getDefaultProps method (React.createClass() syntax), or as a defaultProps static property of the class.

  4. You should add a JSDoc-style comment block for each prop, with a description and optional @examples.

    reateClass() example
    t MyComponent = React.createClass({
    Types: {
    *
     A test prop
     @examples "Test", "More Test", "Yep"
    /
    stProp: React.PropTypes.string
    
    
    er() {
    turn <div>Sample</div>;
    
    
    
    lass declaration example
    OTE: Requires `babel-preset-stage-1`
    s MyComponent extends React.Component {
    ic propTypes = {
    *
     A test prop
     @examples "Test", "More Test", "Yep"
    /
    stProp: React.PropTypes.string
    
    
    er() {
    turn <div>Sample</div>;
    
    
    
Writing Your Component Documentation

Create these files according to the below examples:

Required Props
Optional Props
Deploying Your Docs

Help us write this documentation! https://github.com/FormidableLabs/ecology/issues/20

Development

Please see DEVELOPMENT

Contributing

Please see CONTRIBUTING


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.