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

build(docs): update throws and examples sections to new titles #17616

Merged
merged 2 commits into from Oct 5, 2023

Conversation

RishhiB
Copy link
Contributor

@RishhiB RishhiB commented Oct 4, 2023

Consume the updated api-markdown-documenter package to allow custom titles for the @example and @throws sections.

  1. The api-markdown-documenter package has utility functions createExamplesSection and createThrowsSection in Helpers.ts which was updated to include a optional headingTitle param in v0.9.0. These functions generate sections that describe the @example and @throws comments on an API item, respectively.

  2. 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 @example section and "Error Handling" for the @throws section.

  3. Adjustments on FF.com:

    • The default title in the examples section should be changed from "Examples" to "Usage".
    • The default title in the throws section should be changed from "Throws" to "Error Handling".

image
image

AB#5581

@RishhiB RishhiB self-assigned this Oct 4, 2023
@RishhiB RishhiB requested a review from a team as a code owner October 4, 2023 16:37
@github-actions github-actions bot added area: website base: main PRs targeted against main branch labels Oct 4, 2023
Copy link
Contributor

@scottn12 scottn12 left a 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");
Copy link
Contributor

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?

docs/package.json Show resolved Hide resolved
Copy link
Contributor

@Josmithr Josmithr left a 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!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

🔗 Found some broken links! 💔

Run a link check locally to find them. See
https://github.com/microsoft/FluidFramework/wiki/Checking-for-broken-links-in-the-documentation for more information.

linkcheck output


> fluidframework-docs@0.25.0 ci:linkcheck /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test ci:start http://localhost:1313 linkcheck:full

1: starting server using command "npm run ci:start"
and when url "[ 'http://localhost:1313' ]" is responding with HTTP status code 200
running tests using command "npm run linkcheck:full"


> fluidframework-docs@0.25.0 ci:start
> http-server ./public --port 1313 --silent


> fluidframework-docs@0.25.0 linkcheck:full
> npm run linkcheck:fast -- --external


> fluidframework-docs@0.25.0 linkcheck:fast
> linkcheck http://localhost:1313 --skip-file skipped-urls.txt --external

Crawling...

http://localhost:1313/docs/apis/location-redirection-utils/
- (833:52) => http://localhost:1313/docs/apis/container-loader/-entrypoint (HTTP 404)
- (833:52) => http://localhost:1313/docs/apis/container-loader/-entrypoint (HTTP 404)

http://localhost:1313/docs/apis/runtime-definitions/
- (1703:37) 'https://..' => https://datatracker.ietf.org/doc/html/rfc4122%29 (HTTP 404)
- (1703:37) 'https://..' => https://datatracker.ietf.org/doc/html/rfc4122%29 (HTTP 404)

http://localhost:1313/docs/apis/tree/
- (4170:210) 'https://..' => https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-utils/src/error.ts (HTTP 404)
- (4170:210) 'https://..' => https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-utils/src/error.ts (HTTP 404)

http://localhost:1313/docs/build/bundlers/
- (843:233) 'here' => https://github.com/microsoft/FluidFramework/blob/a4c38234a920abe9b54b1c26a14c0a8e430cd3fa/packages/tools/webpack-fluid-loader/webpack.config.js#L37 (HTTP 200 but missing anchor)

http://localhost:1313/docs/deployment/service-options/
- (848:72) 'Routerli..' => https://github.com/microsoft/FluidFramework/tree/main/server#readme (HTTP 200 but missing anchor)
- (850:168) 'Routerli..' => https://github.com/microsoft/FluidFramework/tree/main/server#readme (HTTP 200 but missing anchor)

http://localhost:1313/docs/faq/
- (927:87) 'Routerli..' => https://github.com/microsoft/FluidFramework/tree/main/server#readme (HTTP 200 but missing anchor)

http://localhost:1313/docs/testing/telemetry/
- (848:3) 'ILoaderP..' => https://github.com/microsoft/FluidFramework/blob/main/packages/loader/container-loader/src/loader.ts#L313 (HTTP 200 but missing anchor)


Stats:
  207678 links
    2024 destination URLs
       2 URLs ignored
       5 warnings
       3 errors

 ELIFECYCLE  Command failed with exit code 1.

@RishhiB RishhiB merged commit 3faabc2 into microsoft:main Oct 5, 2023
28 checks passed
@RishhiB RishhiB deleted the consumeExampleThrowsOptionalChanges branch February 2, 2024 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: website base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants