设计理念

caution

This section is a work in progress.

  • 较少的学习 - Docusaurus should be easy to learn and use as the API is quite small. Most things will still be achievable by users, even if it takes them more code and more time to write. Not having abstractions is better than having the wrong abstractions, and we don't want users to have to hack around the wrong abstractions. Mandatory talk - Minimal API Surface Area.
  • 直观 - Users will not feel overwhelmed when looking at the project directory of a Docusaurus project or adding new features. It should look intuitive and easy to build on top of, using approaches they are familiar with.
  • 分层结构 - The separations of concerns between each layer of our stack (content/theming/styling) should be clear - well-abstracted and modular.
  • 合理的默认值 - Common and popular performance optimizations and configurations will be done for users but they are given the option to override them.
  • 不锁定特定插件 - Users are not required to use the default plugins or CSS, although they are highly encouraged to. Certain core lower-level infra level pieces like React Loadable, React Router cannot be swapped because we do default performance optimization on them. But not higher level ones, such as choice of Markdown engines, CSS frameworks, CSS methodology will be entirely up to users.

Docusaurus 的工作原理

We believe that as developers, knowing how a library works is helpful in allowing us to become better at using it. Hence we're dedicating effort into explaining the architecture and various components of Docusaurus with the hope that users reading it will gain a deeper understanding of the tool and be even more proficient in using it.

Last updated on by wangsai