Skip to content

Commit

Permalink
feat: add mdbook-admonish support (#59)
Browse files Browse the repository at this point in the history
Co-authored-by: sgoudham <sgoudham@gmail.com>
  • Loading branch information
nekowinston and sgoudham committed Sep 16, 2023
1 parent c5dca94 commit c8ba6ec
Show file tree
Hide file tree
Showing 10 changed files with 1,107 additions and 230 deletions.
8 changes: 6 additions & 2 deletions example/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ title = "Catppuccin's mdBook"
[preprocessor]

[preprocessor.catppuccin]
assets_version = "0.2.0" # DO NOT EDIT: Managed by `mdbook-catppuccin install`
assets_version = "0.2.1" # DO NOT EDIT: Managed by `mdbook-catppuccin install`

[preprocessor.admonish]
command = "mdbook-admonish"
assets_version = "2.0.2" # do not edit: managed by `mdbook-admonish install`

[output.html]
default-theme = "mocha"
preferred-dark-theme = "mocha"
additional-css = ["./theme/catppuccin.css", "./theme/catppuccin-highlight.css"]
additional-css = ["./theme/catppuccin.css", "./theme/catppuccin-highlight.css", "./theme/mdbook-admonish.css"]
no-section-label = true
git-repository-url = "https://github.com/catppuccin/mdBook"
git-repository-icon = "fa-github"
Expand Down
3 changes: 2 additions & 1 deletion example/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Summary

- [Landing](./first.md)
- [Landing](./landing.md)
- [Admonishments](./admonish.md)
- [Super Secret](./secret.md)
81 changes: 81 additions & 0 deletions example/src/admonish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Reference

The following admonishments are implemented by the
[`mdbook-admonish`](https://github.com/tommilligan/mdbook-admonish) plugin and
are automatically themed to match Catppuccin.

## Directives

All supported directives are listed below.

`note`

```admonish note
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`abstract`, `summary`, `tldr`

```admonish abstract
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`info`, `todo`

```admonish info
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`tip`, `hint`, `important`

```admonish tip
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`success`, `check`, `done`

```admonish success
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`question`, `help`, `faq`

```admonish question
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`warning`, `caution`, `attention`

```admonish warning
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`failure`, `fail`, `missing`

```admonish failure
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`danger`, `error`

```admonish danger
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`bug`

```admonish bug
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`example`

```admonish example
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```

`quote`, `cite`

```admonish quote
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency.
```
8 changes: 0 additions & 8 deletions example/src/first.md → example/src/landing.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,3 @@ Tables:
| Header 1 | Header 2 |
| -------- | -------- |
| Data 1 | Data 2 |

## Admonishments (NOT SUPPORTED YET - [#2](https://github.com/catppuccin/mdBook/issues/2))

> **Note**:
> This is a note!
> **Warning**:
> This is a warning!
4 changes: 2 additions & 2 deletions example/src/secret.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Super Secret

You thought you'd find something here didn't you?
You thought you'd find something here, didn't you?

Here, have a cookie for your efforts: 🍪
Here, have a cookie for your efforts: 🍪

0 comments on commit c8ba6ec

Please sign in to comment.