mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
|
||
---|---|---|
.. | ||
__tests__ | ||
generator.ts | ||
index.ts | ||
normalization.ts | ||
postProcessor.ts | ||
processor.ts | ||
README.md | ||
types.ts | ||
utils.ts | ||
validation.ts |
Sidebars
This part is very complicated and hard to navigate. Sidebars are loaded through the following steps:
- Loading. The sidebars file is read. Returns
SidebarsConfig
. - Normalization. The shorthands are expanded. This step is very lenient about the sidebars' shapes. Returns
NormalizedSidebars
. - 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.
- 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. ReturnsProcessedSidebars
. - Post-processing. Defaults are applied (collapsed states), category links are resolved, empty categories are flattened. Returns
Sidebars
.