Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in code documentation standards. #4530

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,23 @@ If you'd like to contribute to the design or front-end, feel free to contribute
Documentation is automatically synced from master to the [Gutenberg Documentation Website](https://wordpress.org/gutenberg/handbook/) every 15 minutes.

To add a new documentation page, you'll have to create a Markdown file in the [docs](https://github.com/WordPress/gutenberg/tree/master/docs) folder and add an item to the [manifest file](https://github.com/WordPress/gutenberg/blob/master/docs/manifest.json).

### In Code Documentation

This project uses [JSDoc](http://usejsdoc.org/) for doc blocks. Inline code should be used for describing individual pieces in detail. The in code documentation will hopefully in the future be repurposed for [the WordPress code reference](https://developer.wordpress.org/reference/). If you would like to help contribute to the in code documentation, try adding a JSDoc header to something that needs one! It would be greatly appreciated!

In code documentation priorities:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you come to this prioritization? Should we set prioritization expectations, or merely that all things are to be documented (prioritization implies that you don't need to document everything)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you come to this prioritization?

I believe I went off of what was already documented, and what seemed undocumented (higher undocumented rate lower on prioritization). We can take that part out.

I wrote this for feedback, I have no idea if there should be prioritization. I would probably be most in favor of documenting everything so we can potentially extract the docs out programmatically, but we did not come to a consensus in the JS meeting. Without your and Riad's buy in, since ya'll are doing the vast bulk of the work, it would be unfair to try to impose anything on you two.


- Exports ( Any pieces exported by a file, especially ones that are available as part of a module's public interface. )
- Selectors
- Higher Order Components
- Components ( These are often exports )
- Redux related pieces ( i.e. Actions, Action Creators, Reducers, Effects )

#### Documenting Components

To better document components, provide the following information in a README.md in the component's folder:

- Description
- Usage ( Code example )
- Properties ( if applicable )