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

docs(v2): update Client API docs page #3835

Merged
merged 2 commits into from
Nov 30, 2020

Conversation

Simek
Copy link
Contributor

@Simek Simek commented Nov 27, 2020

Motivation

This PR updates the Docusaurus Client API page and includes following changes:

  • consistent usage of const instead of function,
  • detailed method definitions moved from headings to the code blocks for usePluginData and useAllPluginInstancesData hooks, this improves the readability of ToC
  • added and updated line highlighting in examples.

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

Changes have been tested on Docusuaurs V2 website locally.

Related PRs

No.

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Nov 27, 2020
@netlify
Copy link

netlify bot commented Nov 27, 2020

Deploy preview for docusaurus-2 ready!

Built without sensitive environment variables with commit 4159983

https://deploy-preview-3835--docusaurus-2.netlify.app

@Simek Simek force-pushed the docs-update-api-docusaurus-core branch from e8e8e08 to 10bf8bf Compare November 27, 2020 20:30
Copy link
Contributor

@lex111 lex111 left a comment

Choose a reason for hiding this comment

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

How about using special comments (like highlight-next-line, highlight-start, and highlight-end) for syntax highlighting? https://v2.docusaurus.io/docs/markdown-features/#line-highlighting
This is a more flexible approach.

@Simek
Copy link
Contributor Author

Simek commented Nov 27, 2020

How about using special comments (like highlight-next-line, highlight-start, and highlight-end) for syntax highlighting? https://v2.docusaurus.io/docs/markdown-features/#line-highlighting
This is a more flexible approach.

I think it depends on the use-case, current approach might be more useful (less cluttering) for example, for highlighting single line.

In this PR I have just followed the current style used on the docs page, but I will consider using the syntax you have suggested in the future.

@lex111
Copy link
Contributor

lex111 commented Nov 27, 2020

Fair enough. Before merge, let's just change the order follow of the method signatures to ensure consistency again. I mean, do it by analogy as for useDocusaurusContext section (https://deploy-preview-3835--docusaurus-2.netlify.app/classic/docs/docusaurus-core#usedocusauruscontext), which can be divided into three parts: description, signature/definition, usage example. I propose apply this pattern to all other methods on the page.

@slorber slorber added the pr: documentation This PR works on the website or other text documents in the repo. label Nov 30, 2020
@slorber slorber changed the title docs(V2): update Client API docs page docs(v2): update Client API docs page Nov 30, 2020
@slorber
Copy link
Collaborator

slorber commented Nov 30, 2020

thanks :)

@slorber slorber merged commit e864aa0 into facebook:master Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants