facebook / facebook/docusaurus

Theme protocol documentation

Offen
#6,649 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
documentation
Vorherrschende Sprache
TypeScript
Sterne
66.2k
Forks
10k
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
52

Beschreibung

### 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.