Home

Awesome

<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

  1. Install the binary using one of the methods below.

    Installation MethodInstructions
    Rustcargo install mdbook-catppuccin
    Homebrewbrew install catppuccin/tap/mdbook-catppuccin
    Nixnix profile install github:catppuccin/mdbook
    GitHubDownload the latest release
    ManualSee below
  2. Navigate to your mdBook's root directory (same location where the book.toml lives) and run mdbook-catppuccin install

  3. Build using mdbook build and enjoy your new catppuccin flavours!

Manual Installation

  1. Navigate to src/bin/assets within this repository

  2. Download all assets: index.hbs, catppuccin.css and catppuccin-admonish.css

[!NOTE] The catppuccin-admonish.css file is NOT required if you are not using the mdbook-admonish plugin.

  1. Transfer downloaded assets to your mdBook's theme directory (the default directory is ./theme beside book.toml)

  2. Update additional-css key within the book.toml as shown below

    [output.html]
    -additional-css = []
    +additional-css = ["./theme/catppuccin.css", "./theme/catppuccin-admonish.css"]
    
  3. Build using mdbook build and enjoy your new catppuccin flavours!

Version Compatibility

This table shows the compatibility between the mdBook version and the mdbook-catppuccin version.

[!IMPORTANT]
Updates to the major version may contain BREAKING CHANGES to the index.hbs file, which means that you will have to update the file manually or use mdbook-catppuccin install --force flag to overwrite the index.hbs upon installation.

mdbook-catppuccinmdBook
1.x.x0.4.22 → 0.4.34
2.x.x0.4.35 → latest

Development

  1. Clone the repository and navigate to the repository root.

    git clone https://github.com/catppuccin/mdbook
    cd mdbook
    
  2. Run the following command to generate the CSS files that will be packaged by the rust binary:

    cd palette
    npm install
    npm run build
    
  3. Build the rust binary using the following command:

    Note that the Minimum Rust Version is 1.63.0

    cargo build --release
    
  4. Test the binary by installing the new assets on the example directory:

    cd example
    ../target/release/mdbook-catppuccin install
    mdbook serve
    

🙋 FAQ

Acknowledgement

Inspiration for the install command came from mdbook-admonish which is another great mdBook pre-processor!

💝 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 &copy; 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>