diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 2d507bd..b52b796 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -20,7 +20,7 @@ jobs: - name: Setup mdBook uses: peaceiris/actions-mdbook@v2 with: - mdbook-version: "0.4.40" + mdbook-version: "0.4.42" - name: Download mdbook-admonish run: | mkdir ${{ env.TARGET }} @@ -29,6 +29,14 @@ jobs: env: VERSION: "v1.18.0" TARGET: "mdbook-admonish-v1.18.0-x86_64-unknown-linux-gnu" + - name: Download mdbook-alerts + run: | + mkdir ${{ env.TARGET }} + curl -sSL https://github.com/lambdalisue/rs-mdbook-alerts/releases/download/${{ env.VERSION }}/${{ env.TARGET }}.tar.gz | tar -xz --directory=${{ env.TARGET }} + echo `pwd`/${{ env.TARGET }} >> $GITHUB_PATH + env: + VERSION: "v0.6.9" + TARGET: "mdbook-alerts-x86_64-unknown-linux-gnu" - name: Setup PNPM uses: pnpm/action-setup@v3 - name: Setup Node diff --git a/README.md b/README.md index 280b147..042061e 100644 --- a/README.md +++ b/README.md @@ -60,19 +60,19 @@ 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)**) +3. Download the [catppuccin.css](https://github.com/catppuccin/mdBook/releases/latest/download/catppuccin.css) + file from the [latest GitHub release](https://github.com/catppuccin/mdBook/releases/latest) to the `theme` + directory. + + See the [Supported Plugins](#supported-plugins) section below for integrations with other + mdBook plugins. 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"] + +additional-css = ["./theme/catppuccin.css"] ``` 5. Edit the `index.hbs` file to include the Catppuccin flavours: @@ -103,7 +103,20 @@ + preferred-dark-theme = "mocha" ``` -6. Build using `mdbook build` and enjoy your new catppuccin flavours! +6. Build using `mdbook build` and enjoy your new Catppuccin flavours! + +### Supported Plugins + +This theme also generates CSS files to style elements added by other mdBook +plugins. We support the following list of plugins: + +| Plugin | CSS File | +| ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| [mdbook-admonish](https://github.com/tommilligan/mdbook-admonish) | [catppuccin-admonish.css](https://github.com/catppuccin/mdBook/releases/latest/download/catppuccin-admonish.css) | +| [mdbook-alerts](https://github.com/lambdalisue/rs-mdbook-alerts) | [catppuccin-alerts.css](https://github.com/catppuccin/mdBook/releases/latest/download/catppuccin-alerts.css) | + +The CSS file(s) can be downloaded and added to the `additional-css` key shown +in step `4.` of the [Usage](#usage) section. ## Development @@ -118,25 +131,10 @@ ```shell cd palette - npm install - npm run build + pnpm install + pnpm 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 diff --git a/example/book.toml b/example/book.toml index d4d7b3d..3454def 100644 --- a/example/book.toml +++ b/example/book.toml @@ -9,6 +9,8 @@ title = "Catppuccin's mdBook" command = "mdbook-admonish" assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install` +[preprocessor.alerts] + [output.html] default-theme = "mocha" preferred-dark-theme = "mocha" @@ -16,6 +18,7 @@ additional-css = [ "./theme/catppuccin.css", "./theme/catppuccin-admonish.css", "./theme/mdbook-admonish.css", + "./theme/catppuccin-alerts.css", ] no-section-label = true git-repository-url = "https://github.com/catppuccin/mdBook" diff --git a/example/src/SUMMARY.md b/example/src/SUMMARY.md index 2ec96db..8ea4f9d 100644 --- a/example/src/SUMMARY.md +++ b/example/src/SUMMARY.md @@ -2,4 +2,5 @@ - [Landing](./landing.md) - [Admonishments](./admonish.md) +- [Alerts](./alerts.md) - [Super Secret](./secret.md) diff --git a/example/src/alerts.md b/example/src/alerts.md new file mode 100644 index 0000000..c542950 --- /dev/null +++ b/example/src/alerts.md @@ -0,0 +1,24 @@ +# Reference + +The following alerts are implemented by the +[mdbook-alerts](https://github.com/lambdalisue/rs-mdbook-alerts) plugin and are +automatically themed to match Catppuccin. + +## Alerts + +All supported alerts are listed below. + +> [!NOTE] +> Highlights information that users should take into account, even when skimming. + +> [!TIP] +> Optional information to help a user be more successful. + +> [!IMPORTANT] +> Crucial information necessary for users to succeed. + +> [!WARNING] +> Critical content demanding immediate user attention due to potential risks. + +> [!CAUTION] +> Negative potential consequences of an action. diff --git a/example/theme/catppuccin-alerts.css b/example/theme/catppuccin-alerts.css new file mode 120000 index 0000000..1f8b3f5 --- /dev/null +++ b/example/theme/catppuccin-alerts.css @@ -0,0 +1 @@ +../../dist/catppuccin-alerts.css \ No newline at end of file diff --git a/example/theme/index.hbs b/example/theme/index.hbs index 964cb1a..117fd41 100644 --- a/example/theme/index.hbs +++ b/example/theme/index.hbs @@ -1,5 +1,5 @@ - +
@@ -52,15 +52,17 @@ {{/if}} - - -