[wp-meta] [Making WordPress.org] #3063: Show JavaScript documentation on developer.wordpress.org
Making WordPress.org
noreply at wordpress.org
Tue Feb 5 19:09:11 UTC 2019
#3063: Show JavaScript documentation on developer.wordpress.org
---------------------------+---------------------
Reporter: atimmer | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Developer Hub | Resolution:
Keywords: |
---------------------------+---------------------
Comment (by nosolosw):
I've tried this approach on Gutenberg code. Here's the PullRequest I've
used as a playground to document my findings with specific code samples
from Gutenberg: https://github.com/WordPress/gutenberg/pull/13637
The results weren't what I was expecting so I've tried to tweak it a bit
to learn if they could be improved. I don't have a lot of jsdoc
experience, so I haven't seen how.
In parallel, I was working on a package to generate Public API docs. Given
a ESNext JavaScript file, it outputs a Markdown with its Public API. It
takes a different route than this approach: it builds the Abstract Syntax
Tree of the code, extracts the export declarations of a given file, and
looks backwards from there to find the JSDoc comments up to the
declaration. It contains an extensive test suite that hopefully is useful
to understand how it works as well. It can be found at
https://github.com/WordPress/gutenberg/pull/13329 I've tested it with
every Gutenberg package and it works. It seems feasible within a
reasonable timeline to improve that package and output a JSON tailored for
developer.wordpress.org. From what I've seen, it basically needs to add
file references (line numbers, names), and namespaces.
@herregroen @atimmer I was wondering whether you'd take a look at those
PullRequests and let me know what do you think?
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/3063#comment:8>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list