Making WordPress.org

Opened 11 months ago

Last modified 11 months ago

#3063 new enhancement

Show JavaScript documentation on developer.wordpress.org

Reported by: atimmer Owned by:
Milestone: Priority: normal
Component: Developer Hub Keywords:


There is a ton of work going into making the JavaScript documentation up to the same standard as the PHP documentation. This is now in a state where we could feasibly add it to developer.wordpress.org.

After https://core.trac.wordpress.org/ticket/41682#comment:7 has been merged the output is useful.

The way the PHP function/method/hook documentation works is by parsing the PHP source code and creating WordPress posts for every symbol. With every WordPress update this process is repeated and the posts are updated. This makes is possible to have user contributed notes and have extra documentation which is edited in a backend meta field.

This would be the way to setup the JavaScript documentation on developer.wordpress.org. The PHP code can be found at https://github.com/wordpress/phpdoc-parser. I have started a JS version on https://github.com/yoast/jsdoc-parser.

I investigated several solutions into parsing the JavaScript source code in WordPress. I tried both https://github.com/documentationjs and https://esdoc.org but both of these have failings. They both have a very hard time handling the JavaScript structure of WordPress core. JSDoc does this much better. And since JSDoc switched to babylon as their JS parser they can handle ES201* very fine now.

Change History (2)

This ticket was mentioned in Slack in #core-js by atimmer. View the logs.

11 months ago

This ticket was mentioned in Slack in #docs by atimmer. View the logs.

11 months ago

Note: See TracTickets for help on using tickets.