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
build(docs): update throws and examples sections to new titles #17616
build(docs): update throws and examples sections to new titles #17616
Conversation
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.
Looks good! Left a tiny nit if you want :)
| @@ -84,7 +84,7 @@ function layoutContent(apiItem, itemSpecificContent, config) { | |||
| } | |||
|
|
|||
| // Render examples (if any) | |||
| const renderedExamples = LayoutUtilities.createExamplesSection(apiItem, config); | |||
| const renderedExamples = LayoutUtilities.createExamplesSection(apiItem, config, "Usage"); | |||
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.
nit: maybe let's move out the string constants "Usage" and "Error Handling" out into consts at the top of this function so they are easier to find in the future?
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.
Looks good! I agree with Scott's comments, but otherwise this looks ready to go!
|
🔗 Found some broken links! 💔 Run a link check locally to find them. See linkcheck output |
Consume the updated
api-markdown-documenterpackage to allow custom titles for the@exampleand@throwssections.The
api-markdown-documenterpackage has utility functionscreateExamplesSectionandcreateThrowsSectioninHelpers.tswhich was updated to include a optional headingTitle param in v0.9.0. These functions generate sections that describe the@exampleand@throwscomments on an API item, respectively.At present, the headings "Examples" and "Throws" are hard-coded for these sections. For FF.com, we aim to use custom titles "Usage" for the
@examplesection and "Error Handling" for the@throwssection.Adjustments on FF.com:
AB#5581