MdBook
π Soothing pastel theme for mdBook
Install / Use
/learn @catppuccin/MdBookREADME
<h3 align="center">
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/logos/exports/1544x1544_circle.png" width="100" alt="Logo"/><br/>
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/misc/transparent.png" height="30" width="0px"/>
Catppuccin for <a href="https://rust-lang.github.io/mdBook/">mdBook</a>
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/misc/transparent.png" height="30" width="0px"/>
</h3>
<p align="center">
<a href="https://github.com/catppuccin/mdBook/stargazers"><img src="https://img.shields.io/github/stars/catppuccin/mdBook?colorA=363a4f&colorB=b7bdf8&style=for-the-badge"></a>
<a href="https://github.com/catppuccin/mdBook/issues"><img src="https://img.shields.io/github/issues/catppuccin/mdBook?colorA=363a4f&colorB=f5a97f&style=for-the-badge"></a>
<a href="https://github.com/catppuccin/mdBook/contributors"><img src="https://img.shields.io/github/contributors/catppuccin/mdBook?colorA=363a4f&colorB=a6da95&style=for-the-badge"></a>
<a href="https://crates.io/crates/mdbook-catppuccin"><img src="https://img.shields.io/crates/v/mdbook-catppuccin?colorA=363a4f&colorB=ee99a0&style=for-the-badge"></a>
</p>
<p align="center">
<img src="assets/catwalk.webp"/>
</p>
Previews
<details> <summary>π» Latte</summary> <img src="assets/latte.webp"/> </details> <details> <summary>πͺ΄ FrappΓ©</summary> <img src="assets/frappe.webp"/> </details> <details> <summary>πΊ Macchiato</summary> <img src="assets/macchiato.webp"/> </details> <details> <summary>πΏ Mocha</summary> <img src="assets/mocha.webp"/> </details>Usage
-
Initialise your mdBook with the theme files:
mdbook init --theme <name> -
Enter the book directory and remove all theme files except
index.hbs:cd <name> # Remove all files except index.hbs find ./theme -type f ! -name 'index.hbs' -delete # Remove the left over empty directories rm -d fonts css -
Download the catppuccin.css file from the latest GitHub release to the
themedirectory. -
Update
additional-csskey within thebook.tomlas shown below[output.html] -additional-css = [] +additional-css = ["./theme/catppuccin.css"] -
Edit the
index.hbsfile to include the Catppuccin flavors:- <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li> - <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li> - <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li> - <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li> - <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li> + <li role="none"><button role="menuitem" class="theme" id="latte">Latte</button></li> + <li role="none"><button role="menuitem" class="theme" id="frappe">FrappΓ©</button></li> + <li role="none"><button role="menuitem" class="theme" id="macchiato">Macchiato</button></li> + <li role="none"><button role="menuitem" class="theme" id="mocha">Mocha</button></li>Additionally, you can use default-theme and preferred-dark-theme keys for setting default light/dark mode themes in your
book.toml.E.g. To set the default theme to
latteand default dark mode tomocha:[output.html] + default-theme = "latte" + preferred-dark-theme = "mocha" -
Build using
mdbook buildand enjoy your new Catppuccin flavors!
Development
-
Clone the repository and navigate to the repository root.
git clone https://github.com/catppuccin/mdbook cd mdbook -
Generate the CSS files:
pnpm install pnpm run build
π Thanks to
Β
<p align="center"> <img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/footers/gray0_ctp_on_line.svg?sanitize=true" /> </p> <p align="center"> Copyright © 2021-present <a href="https://github.com/catppuccin" target="_blank">Catppuccin Org</a> </p> <p align="center"> <a href="https://github.com/catppuccin/catppuccin/blob/main/LICENSE"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a> </p>