Repository navigation
docs: refactor API documentation - #5219
Conversation
Signed-off-by: Josh-Cena <[email protected]>
|
✔️ [V2] 🔨 Explore the source changes: 50a24d4 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/610aa1fe11e88600089654d8 😎 Browse the preview: https://deploy-preview-5219--docusaurus-2.netlify.app |
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5219--docusaurus-2.netlify.app/ |
Signed-off-by: Josh-Cena <[email protected]>
Signed-off-by: Josh-Cena <[email protected]>
Signed-off-by: Josh-Cena <[email protected]>
Signed-off-by: Josh-Cena <[email protected]>
Signed-off-by: Josh-Cena <[email protected]>
lex111
left a comment
There was a problem hiding this comment.
Nice improvement! However I would fix the following ones:
- Element
tablenot allowed as child of elementsmallin this context. And in general it makes little sense to reduce font size in table at all. - It is also better to move Default column right after Type. Many docs follow exactly this ordering of columns in similar tables (
name | type | default | description).
Agree that it looks awkward, but using regular font would over-compress the column width of the "description" field and make the layout even more awkward... The other doc sites I've seen use a smaller font size (Ant Design, Vuetify, etc.). Should I use styling instead?
Absolutely, makes sense |
Signed-off-by: Josh-Cena <[email protected]>
Signed-off-by: Josh-Cena <[email protected]>
|
Yes, but small font is uncomfortable to read, so it's better use regular font size. Let's wait for opinion from @slorber then. |
Signed-off-by: Josh-Cena <[email protected]>
| | `sidebarItemsGenerator` | `SidebarGenerator` | _Omitted_ | Function used to replace the sidebar items of type `'autogenerated'` by real sidebar items (docs, categories, links...). See also [Customize the sidebar items generator](/docs/sidebar#customize-the-sidebar-items-generator) | | ||
| | `numberPrefixParser` | <code>boolean | PrefixParser</code> | _Omitted_ | Custom parsing logic to extract number prefixes from file names. Use `false` to disable this behavior and leave the docs untouched, and `true` to use the default parser. See also [Using number prefixes](/docs/sidebar#using-number-prefixes) | | ||
| | `docLayoutComponent` | `string` | `'@theme/DocPage'` | Root Layout component of each doc page. | | ||
| | `docItemComponent` | `string` | `'@theme/DocItem'` | Main doc container, with TOC, pagination, etc. | |
There was a problem hiding this comment.
Need some help here, I don't really understand the difference between DocPage and DocItem even after reading the code
There was a problem hiding this comment.
DocPage is more like the comp responsible for handling the routing and layout inside a doc version.
Keep descriptions as is, I'll try to figure out how to organize this better later and try to rename those comps
Signed-off-by: Josh-Cena <[email protected]>
|
Thanks, that's a good improvement and will also fix some searchability issues due to having options only documented in code blocks!
Small looks better to me, but I understand why it can be an a11y concern. At the same time it remains big enough and users can still use their browser zoom? Not using small will penalize all users with a less readable layout so I'd suggest to keep small Will try to review this in depth later |
Signed-off-by: Josh-Cena <[email protected]>
Signed-off-by: Josh-Cena <[email protected]>
# Conflicts: # website/docs/api/themes/theme-configuration.md
|
looks good, thanks 👍 and it solves some searcheability issues we have with algolia + codeblocks. Going to merge. Open to refine the table/small thing is someone has something better to suggest. It is also possible that this small HTML item can mess up with Crowdin docs translations: we'll see after merging. |
|
It seems to me that adding a module css may not be a bad choice, but we can wait and see since the current solution has less code |
I don't understand what you mean 😅 |
|
I mean, adding an .apiTable {
font-size: 10px;
}And then apply this class to every table that we wrap with |
|
Having an If possible I'd prefer to use simple markup without React props because it tends to mess-up a bit with Crowdin without using |
* Refactor plugin-docs documentation Signed-off-by: Josh-Cena <[email protected]> * Refactor theme-configuration Signed-off-by: Josh-Cena <[email protected]> * Refactor plugin-blog docs Signed-off-by: Josh-Cena <[email protected]> * Fix link Signed-off-by: Josh-Cena <[email protected]> * plugin-pages Signed-off-by: Josh-Cena <[email protected]> * Minor change Signed-off-by: Josh-Cena <[email protected]> * Interchange table columns Signed-off-by: Josh-Cena <[email protected]> * Fixes Signed-off-by: Josh-Cena <[email protected]> * Minor improvements Signed-off-by: Josh-Cena <[email protected]> * Fix hash link Signed-off-by: Josh-Cena <[email protected]> * Move blog front matter to API Signed-off-by: Josh-Cena <[email protected]> * Add more blog documentation Signed-off-by: Josh-Cena <[email protected]> * Update blog.md * Update blog.md * Update blog.md * Update website/docs/blog.md Co-authored-by: Sébastien Lorber <[email protected]> Co-authored-by: slorber <[email protected]>
* Refactor plugin-docs documentation Signed-off-by: Josh-Cena <[email protected]> * Refactor theme-configuration Signed-off-by: Josh-Cena <[email protected]> * Refactor plugin-blog docs Signed-off-by: Josh-Cena <[email protected]> * Fix link Signed-off-by: Josh-Cena <[email protected]> * plugin-pages Signed-off-by: Josh-Cena <[email protected]> * Minor change Signed-off-by: Josh-Cena <[email protected]> * Interchange table columns Signed-off-by: Josh-Cena <[email protected]> * Fixes Signed-off-by: Josh-Cena <[email protected]> * Minor improvements Signed-off-by: Josh-Cena <[email protected]> * Fix hash link Signed-off-by: Josh-Cena <[email protected]> * Move blog front matter to API Signed-off-by: Josh-Cena <[email protected]> * Add more blog documentation Signed-off-by: Josh-Cena <[email protected]> * Update blog.md * Update blog.md * Update blog.md * Update website/docs/blog.md Co-authored-by: Sébastien Lorber <[email protected]> Co-authored-by: slorber <[email protected]>
Motivation
While working on the documentation, I found that the API documentation is quite hard to follow with a giant code block. This PR attempts to use tables consistently for all API.
As I continued working on the refactoring, I realized that this will also resolve #3643.
Have you read the Contributing Guidelines on pull requests?
Yes
Test plan
Changes include:
Related PRs
Initially documentation for #5203, but when I merged this branch I found some docs already written 😂 Anyways I also enhanced related docs