Using themes
Pick a theme by short name, npm package or local path, and pass it options.
A theme decides how your docs look: the layout, the components and the styles. yaakdoc ships with Kiseki, and you can switch to another theme using your yaakdoc config:
{
"theme": "kiseki",
"themeOptions": {
"codePanel": "inline"
}
}themeOptions are specific to each theme. The theme validates them and fills in defaults.
How themes are found
theme accepts:
- A short name, such as
winxp. yaakdoc tries@yaakdoc/theme-winxp, thenyaakdoc-theme-winxp, thenwinxp. - A package name, such as
yaakdoc-theme-winxpor@acme/docs-theme. - A local path, such as
./theme, e.g. an ejected theme.
Install npm themes next to your config:
npm i -D yaakdoc-theme-winxpThe Yaak plugin installs npm themes for you.
The CLI's --theme (-t) flag overrides the config, so you can try a theme without editing anything:
npx yaakdoc --theme ./my-themeCustomizing
From the smallest change to the biggest:
- Branding: colors, fonts, logo and links, through the config. Every theme supports these.
- Theme options: whatever the theme offers, such as Kiseki's options.
- Custom CSS: small style tweaks on top of the theme.
- Ejecting: copy the theme into your project and change anything.
- Your own theme: start from unstyled React components.