facebook / facebook/docusaurus

Theme protocol documentation

Abierto
#6,649 8 comentarios 0 reacciones 0 asignados Ver en GitHub
documentation
Lenguaje dominante
TypeScript
Estrellas
66.2k
Forks
10k
Merge medio
1 d 3 h
PR fusionados (30 d)
52

Descripción

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues).

### Description

As we are starting to make another theme (and also allow users to create their own themes from scratch), we should make clear what a theme needs to implement at the bare minimum, and what props these components will receive.

This includes:

- Route components, mostly documented in https://docusaurus.io/docs/advanced/routing. These are a must because plugins call these directly.
- The tabs component, because the npm2yarn remark plugin depends on it.

And that's it! We just need to make sure that the props are stable. For now, this is ensured through typedefs, but in the future, if we no longer use module declarations (discussed in #6629), these implicit protocols will not be present. We need something more explicit than that.

Note that `themeConfig` is intentionally left out of this list. I strongly believe that, while `navbar` and `footer` and `prism` and stuff are useful, they are not _obligatory_. A theme should be allowed without them, or have a different API shape.

### Self-service

- [X] I'd be willing to address this documentation request myself.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.