docusaurus/packages/docusaurus-plugin-content-docs/src/sidebars
Bharatesh 44ddada37a
fix(docs): the _category_.json description attribute should display on generated index pages (#10324)
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
2024-08-09 11:32:21 +02:00
..
__tests__ fix(docs): the _category_.json description attribute should display on generated index pages (#10324) 2024-08-09 11:32:21 +02:00
README.md fix(content-docs): restore functionality when a category only has index page (#7385) 2022-05-10 14:50:43 +08:00
generator.ts fix(docs): the _category_.json description attribute should display on generated index pages (#10324) 2024-08-09 11:32:21 +02:00
index.ts feat(core): support TypeScript + ESM configuration (#9317) 2023-10-14 02:46:03 +02:00
normalization.ts fix(content-docs): allow translating doc labels in sidebars.js (#7634) 2022-06-16 16:11:21 +02:00
postProcessor.ts fix(docs): the _category_.json description attribute should display on generated index pages (#10324) 2024-08-09 11:32:21 +02:00
processor.ts chore(plugin-docs): remove legacy versioned prefix on doc ids and sidebar names in versioned sidebars (#9310) 2023-09-15 18:52:42 +02:00
types.ts fix(docs): the _category_.json description attribute should display on generated index pages (#10324) 2024-08-09 11:32:21 +02:00
utils.ts fix(docs): sidebar item label impact the pagination label of docs (#10025) 2024-04-11 18:26:11 +02:00
validation.ts fix(docs): the _category_.json description attribute should display on generated index pages (#10324) 2024-08-09 11:32:21 +02:00

Sidebars

This part is very complicated and hard to navigate. Sidebars are loaded through the following steps:

  1. Loading. The sidebars file is read. Returns SidebarsConfig.
  2. Normalization. The shorthands are expanded. This step is very lenient about the sidebars' shapes. Returns NormalizedSidebars.
  3. Validation. The normalized sidebars are validated. This step happens after normalization, because the normalized sidebars are easier to validate, and allows us to repeatedly validate & generate in the future.
  4. Generation. This step is done through the "processor" (naming is hard). The autogenerated items are unwrapped. In the future, steps 3 and 4 may be repeatedly done until all autogenerated items are unwrapped. Returns ProcessedSidebars.
    • Important: this step should only care about unwrapping autogenerated items, not filtering them, writing additional metadata, applying defaults, etc.—everything will be handled in the post-processor. Important because the generator is exposed to the end-user and we want it to be easy to be reasoned about.
  5. Post-processing. Defaults are applied (collapsed states), category links are resolved, empty categories are flattened. Returns Sidebars.