You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6.0.0 Release
- Added ability to define admonitions without using a code block
- Added `.admonition-plugin` class to top level element
- Add command to "Insert Admonition" with a modal chooser
- Add command to "Replace Admonitions with HTML"
Copy file name to clipboardExpand all lines: README.md
+81-1Lines changed: 81 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla.
32
32
```
33
33
````
34
34
35
-
Please note that as of **4.4.1**, the `title` and `collapse` parameters must be at the *top* of the block, in any order.
35
+
Please note that as of **4.4.1**, the `title` and `collapse` parameters must be at the _top_ of the block, in any order.
36
36
37
37
### Titles
38
38
@@ -330,6 +330,76 @@ An icon without a title will have this CSS:
330
330
}
331
331
```
332
332
333
+
## Global Commands
334
+
335
+
Several commands are available for the plugin by default.
336
+
337
+
### Collapse and Open All Admonitions In Note
338
+
339
+
If these two commands are triggered with an open note, all collapsible admonitions will be collapsed or open respectively.
340
+
341
+
### Replace Admonitions With HTML
342
+
343
+
Replace _all_ admonition source blocks with the rendered HTML in the note content.
344
+
345
+
This command will overwrite all Admonitions in the open note.
346
+
347
+
### Insert Admonition
348
+
349
+
This will open a modal where the admonition type, title and collapse behavior can be set, then the generated admonition code block will be inserted into the open editor.
350
+
351
+
### Admonition-specific commands
352
+
353
+
Commands may be registered for each custom admonition type to insert them into an open note by clicking the `Register Commands` button.
354
+
355
+
See [this section](#register-and-unregister-commands) for more information.
356
+
357
+
## Non-code block Admonitions
358
+
359
+
As of version 6.0.0, there is a new setting: Enable Non-codeblock Admonitions.
360
+
361
+
This setting is highly experimental and may not work as expected, and there are a few caveats listed at the end of this section to keep in mind.
362
+
363
+
This setting allows for creating an admonition without wrapping it in a code block, which means that links and tags will sync into Obsidian's cache. A non-codeblock admonition may be created using the following syntax:
364
+
365
+
```
366
+
!!! ad-<type> Title goes here!
367
+
368
+
content
369
+
370
+
--- admonition
371
+
```
372
+
373
+
This will create the appropriate admonition type, embed the content, and give it the supplied title.
374
+
375
+
A collapsible admonition may be created using the following syntax:
376
+
377
+
```
378
+
??? ad-<type> Title goes here!
379
+
380
+
content
381
+
382
+
--- admonition
383
+
```
384
+
385
+
A collapsible admonition may default to "open" by appending a +:
386
+
387
+
```
388
+
???+ ad-<type> Title goes here!
389
+
390
+
content
391
+
392
+
--- admonition
393
+
```
394
+
395
+
### Caveats
396
+
397
+
1. Changing to admonition content after render require the cache to be cleared. The note must be closed and re-opened (and sometimes, a different note must be opened first).
398
+
2. Nested admonitions are not currently supported.
399
+
3. Empty titles are not currently supported.
400
+
401
+
If you experience any bugs using this setting, please create an issue and I will look into them.
402
+
333
403
## Settings
334
404
335
405
### Syntax Highlighting
@@ -342,6 +412,10 @@ This will attempt to sync internal links within admonitions to the metadata cach
342
412
343
413
This setting is experimental and could have unintended consequences. If you begin to experience odd behavior, try turning it off and reloading Obsidian.
344
414
415
+
### Enable Non-codeblock Admonitions
416
+
417
+
Allow use of non-codeblock admonitions, described [here](#non-code-block-admonitions).
418
+
345
419
### Collapsible By Default
346
420
347
421
Admonitions will be automatically rendered as collapsible (open) by default.
@@ -382,6 +456,12 @@ No additional features are planned at this time. If there is a feature missing t
382
456
383
457
# Version History
384
458
459
+
## 6.0.0
460
+
- Added ability to define admonitions without using a code block
461
+
- Added `.admonition-plugin` class to top level element
462
+
- Add command to "Insert Admonition" with a modal chooser
463
+
- Add command to "Replace Admonitions with HTML"
464
+
385
465
## 5.0.0
386
466
387
467
- Added [RPG Awesome Icons](http://nagoshiashumari.github.io/Rpg-Awesome/) as an option for admonition icons.
0 commit comments