Skip to content

Commit

Permalink
update doc and nits
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickseurin committed Apr 29, 2024
1 parent 271eb97 commit 11f78c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions book/src/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on_failure = "bail"
[preprocessor.admonish.default]
collapsible = true

[preprocessor.admonish.default.builtins_collapsible]
summary = false
warning = false

[preprocessor.admonish.renderer.test]
render_mode = "strip"
```
Expand All @@ -38,6 +42,7 @@ Subfields:

- `default.title` (optional): Title to use for blocks. Defaults to the directive used in titlecase.
- `default.collapsible` (optional, default: `false`): Make blocks collapsible by default when set to `true`.
- `default.builtins_collapsible` (optional): Allows to make specific builtin directives collapsible when set to `true` (or to make them non-collapsible when set to `false`, overriding the value of `default.collapsible`)
- `default.css_id_prefix` (optional, default: `"admonition-"`): The default css id prefix to add to the id of all blocks. Ignored on blocks with an `id` field.

### `renderer`
Expand Down Expand Up @@ -89,6 +94,7 @@ Add blocks using TOML's [Array of Tables](https://toml.io/en/v1.0.0#array-of-tab
directive = "expensive"
icon = "./money-bag.svg"
color = "#24ab38"
collapsible = true
aliases = ["money", "cash", "budget"]
```

Expand All @@ -97,6 +103,7 @@ Subfields:
- `directive`: The keyword to use this type of block.
- `icon`: A filepath relative to the book root to load an SVG icon from.
- `color`: An RGB hex encoded color to use for the icon.
- `collapsible` (optional): The default boolean value of the collapsible property for this type of block.
- `aliases` (optional): One or more alternative directives to use this block.
- `title` (optional): The default title for this type of block. If not specified, defaults to the directive in title case. To give each alias a custom title, add multiple custom blocks.

Expand Down
2 changes: 1 addition & 1 deletion src/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ mod test {
}

#[test]
fn test_admonition_info_from_raw_with_custom_directive_and_collapsible() {
fn test_admonition_info_from_raw_with_collapsible_custom_directive() {
assert_eq!(
AdmonitionMeta::resolve(
InstanceConfig {
Expand Down

0 comments on commit 11f78c9

Please sign in to comment.