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

Improve autogenerated API docs #14549

Merged
merged 10 commits into from
Mar 27, 2019
Merged

Improve autogenerated API docs #14549

merged 10 commits into from
Mar 27, 2019

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Mar 21, 2019

Closes #14290

It makes the symbol names to stand out and be more compact by toning down other parts of the symbol description.

@oandregal
Copy link
Member Author

cc @aduth @gziolo here's to improve the formatting of the current docs that we talked about in some PRs.

@oandregal oandregal changed the title Improve the way symbols are documented Improve autogenerated API docs Mar 21, 2019
### setup

[src/index.js#L16-L26](src/index.js#L16-L26)
<a name="setup" href="#setup">#</a> **setup** [\<>](src/index.js#L16-L26)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe not to be addressed here, but the relative links for code are dead links in NPM:

https://www.npmjs.com/package/@wordpress/a11y

It appears NPM tries to append it to the GitHub repository, and it may be that once they properly support the new repository.directory on their website it becomes fixed.

Copy link
Member

Choose a reason for hiding this comment

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

Curious, was there some prior art for the <> ? Is it meant to be an abbreviated message of "this is the code!" ? Once I understood it, it seemed fine enough. But I'd be lying if I said my initial reaction wasn't to consider it as being some erroneous output.

Copy link
Member Author

@oandregal oandregal Mar 21, 2019

Choose a reason for hiding this comment

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

Yeah, there is an issue for the links. I plan to address it next. It's also a problem in the handbook.

The <> idea I took it from D3 API docs such as: https://github.com/d3/d3-brush/blob/master/README.md#api-reference

### setup

[src/index.js#L16-L26](src/index.js#L16-L26)
<a name="setup" href="#setup">#</a> **setup** [\<>](src/index.js#L16-L26)
Copy link
Member

Choose a reason for hiding this comment

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

I'd be curious if NPM would strip anything of the custom anchor tag. Is there a reason it ought not be a heading, or is that the idea of "toning down"? Structurally / semantically, it seemed to make sense as a heading.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, just that this approach made the symbols more prominent. I'm on mobile now but can upload some before/after images.

Copy link
Member

Choose a reason for hiding this comment

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

Since it's auto-generated it probably doesn't matter that much whether we use heading. However, I'm curious if we could keep h3 as it helped to give more focus to the method name.

### setup

[src/index.js#L16-L26](src/index.js#L16-L26)
<a name="setup" href="#setup">#</a> **setup** [\<>](src/index.js#L16-L26)
Copy link
Member

Choose a reason for hiding this comment

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

Were you still planning to apply the code formatting, as per #14290 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Tried that as well but liked this more.

@oandregal oandregal requested a review from aduth March 22, 2019 09:34
@oandregal oandregal force-pushed the update/docgen/formatter branch 2 times, most recently from 10c2b2c to 797917f Compare March 26, 2019 20:43
@oandregal
Copy link
Member Author

This has been rebased and is ready for review. cc @aduth @gziolo

@oandregal
Copy link
Member Author

Rebased and formatted the recently added data package.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

It's fine as is, I would be fine to make method names stand out more. Let's get this in and iterate :)

We definitely need to address relative URLs separately. It's way more important.

@oandregal oandregal merged commit ac06e57 into master Mar 27, 2019
@oandregal oandregal deleted the update/docgen/formatter branch March 27, 2019 09:03
@youknowriad youknowriad added this to the 5.4 (Gutenberg) milestone Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] Docgen /packages/docgen [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants