-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Changes from all commits
920036c
07ba5f1
dd1dac6
3beb2e6
e4ceb4d
f1d2dda
8c4e5bf
ef5ce25
c741079
c4cadf2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,20 +16,16 @@ _This package assumes that your code will run in an **ES2015+** environment. If | |
|
||
<!-- START TOKEN(Autogenerated API docs) --> | ||
|
||
### setup | ||
|
||
[src/index.js#L16-L26](src/index.js#L16-L26) | ||
<a name="setup" href="#setup">#</a> **setup** [\<>](src/index.js#L16-L26) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Were you still planning to apply the code formatting, as per #14290 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried that as well but liked this more. |
||
|
||
Create the live regions. | ||
|
||
### speak | ||
|
||
[src/index.js#L52-L66](src/index.js#L52-L66) | ||
<a name="speak" href="#speak">#</a> **speak** [\<>](src/index.js#L52-L66) | ||
|
||
Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions. | ||
This module is inspired by the `speak` function in wp-a11y.js | ||
|
||
**Usage** | ||
_Usage_ | ||
|
||
```js | ||
import { speak } from '@wordpress/a11y'; | ||
|
@@ -41,10 +37,10 @@ speak( 'The message you want to send to the ARIA live region' ); | |
speak( 'The message you want to send to the ARIA live region', 'assertive' ); | ||
``` | ||
|
||
**Parameters** | ||
_Parameters_ | ||
|
||
- **message** `string`: The message to be announced by Assistive Technologies. | ||
- **ariaLive** `string`: Optional. The politeness level for aria-live. Possible values: polite or assertive. Default polite. | ||
- _message_ `string`: The message to be announced by Assistive Technologies. | ||
- _ariaLive_ `string`: Optional. The politeness level for aria-live. Possible values: polite or assertive. Default polite. | ||
|
||
|
||
<!-- END TOKEN(Autogenerated API docs) --> | ||
|
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.There was a problem hiding this comment.
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