Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/catppuccin/mdBook
π Soothing pastel theme for mdBook
https://github.com/catppuccin/mdBook
catppuccin hacktoberfest markdown mdbook mdbook-preprocessor mdbook-theme theme
Last synced: 3 months ago
JSON representation
π Soothing pastel theme for mdBook
- Host: GitHub
- URL: https://github.com/catppuccin/mdBook
- Owner: catppuccin
- License: mit
- Created: 2022-07-24T03:50:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-11T04:35:02.000Z (12 months ago)
- Last Synced: 2024-05-11T01:02:42.665Z (9 months ago)
- Topics: catppuccin, hacktoberfest, markdown, mdbook, mdbook-preprocessor, mdbook-theme, theme
- Language: CSS
- Homepage: http://mdbook.catppuccin.com
- Size: 3.34 MB
- Stars: 124
- Watchers: 5
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Catppuccin for mdBook
## Previews
π» Latte
πͺ΄ FrappΓ©
πΊ Macchiato
πΏ Mocha
## Usage
> [!IMPORTANT]
> The `mdbook-catppuccin` rust package has been deprecated. For further information
> on why this decision was made, please refer to
> [catppuccin/mdBook#107](https://github.com/catppuccin/mdBook/issues/107)
>
> Please follow the instructions below to install the Catppuccin theme for mdBook.1. Initialise your mdBook with the theme files:
```shell
mdbook init --theme
```2. Enter the book directory and remove all theme files except `index.hbs`:
```shell
cd
# Remove all files except index.hbs
find ./theme -type f ! -name 'index.hbs' -delete
# Remove the left over empty directories
rm -d fonts css
```3. Download the CSS files from the [latest GitHub release](https://github.com/catppuccin/mdBook/releases/latest) to the `theme` directory:
- [catppuccin.css](https://github.com/catppuccin/mdBook/releases/latest/download/catppuccin.css)
- [catppuccin-admonish.css](https://github.com/catppuccin/mdBook/releases/latest/download/catppuccin-admonish.css)
(**Only required if you are using
[mdbook-admonish](https://github.com/tommilligan/mdbook-admonish)**)4. Update `additional-css` key within the `book.toml` as shown below
```diff
[output.html]
-additional-css = []
+additional-css = ["./theme/catppuccin.css", "./theme/catppuccin-admonish.css"]
```5. Edit the `index.hbs` file to include the Catppuccin flavours:
```diff
-
-
-
-
-
+
+
+
+
```
Additionally, you can use
[default-theme](https://rust-lang.github.io/mdBook/format/configuration/renderers.html?highlight=default-theme#html-renderer-options)
and
[preferred-dark-theme](https://rust-lang.github.io/mdBook/format/configuration/renderers.html?highlight=preferred-dark-theme#html-renderer-options)
keys for setting default light/dark mode themes in your `book.toml`.
E.g. To set the default theme to `latte` and default dark mode to `mocha`:
```diff
[output.html]
+ default-theme = "latte"
+ preferred-dark-theme = "mocha"
```
6. Build using `mdbook build` and enjoy your new catppuccin flavours!
## Development
1. Clone the repository and navigate to the repository root.
```shell
git clone https://github.com/catppuccin/mdbook
cd mdbook
```
2. Generate the CSS files:
```shell
cd palette
npm install
npm run build
```
## π FAQ
- Q: **_"What's the `catppuccin-admonish.css` file?"_**\
A: It is a CSS file that is used to style the admonishments that are generated
by [mdbook-admonish](https://github.com/tommilligan/mdbook-admonish).
**You can remove this file if you are not using this plugin.**
E.g.
```diff
[output.html]
- additional-css = ["./theme/catppuccin.css", "./theme/catppuccin-admonish.css"]
+ additional-css = ["./theme/catppuccin.css"]
```
## Acknowledgement
[mdbook-admonish](https://github.com/tommilligan/mdbook-admonish) for
inspiration on the `install` command for the now deprecated `mdbook-catppuccin`
binary.
## π Thanks to
- [Hamothy](https://github.com/sgoudham)
- [winston](https://github.com/nekowinston)
Β
Copyright Β© 2021-present Catppuccin Org