Admonition plugin

Yes, that did it! Ah, so in the future when creating a “new” type it would just need to be “task” is that correct?

Thanks for your time.

Yep, exactly.

2 Likes

@valentine.195 today for some reason all of my Admonition blocks are all expanded (Windows 10 & Android mobile). Even though most of them are set to be collapsed (aka empty instead of ‘open’). This happened before the update. The update did not fix the issue.

Any thoughts? Has anyone else experienced this today?

The update did not fix the issue.

Are you talking about 5.0.2 (just released today)?

Edit: Should be fixed in 5.0.3. Please check and let me know if it is not.

The blocks are still expanded in 5.03 (Obsidian v0.12.5) and they also show content: and collapse in the content block (see below)

content: Python
collapse:open

content: Tasks linked to a goal, with a specific date or time-frame
collapse:

Ah, okay. In order to make it easier to support nested admonitions, release v4.4.1:

  1. Removed legacy support for the content parameter.
  2. Now requires collapse and title to be at the top of the block, in any order. For example:
```ad-note
title: Title
collapse:

This is the admonition content.
```

Please try updating to this format and let me know if you’re still experiencing this.

I missed that somewhere along the way. : - ) Seems to be working now. Thanks.

Question about nested codeblocks in the latest version: They appear to work with javascript, but not with dataview; dataview codeblocks don’t render within the admonition codeblock. Is that not allowed/possible, or is there something I’m not doing correctly?

My guess is this is not possible. It seems that if a plugin returns a MarkdownRenderChild that then replaces the element sent to the postProcessor when the child is loaded will not work, because the onload event is not fired (possibly?). Not 100% sure, but I tested a few different plugins and the ones that do this do not render.

1 Like

Absolutely love this plugin, thank you for your work!

Is there any way to use this with Obsidian Publish? That would be fantastic.

1 Like

I don’t believe any plugin works with Publish, right? If there is an example out there I’d be happy to take a look at how they achieve it.

Unfortunately, though, I do not have publish and cannot test it.

That’s what I figured. It’s quite unfortunate really, it severely restricts my use of this wonderful plugin since I publish many of my notes. Maybe there’s a CSS hack somewhere, I’ll try to figure it out.

It does look like the plugin code blocks that are rendered in Publish maintain their language-<plugin> (aka language-ad-note, etc) class.

This could be leveraged to apply the plugin’s CSS (see here), but you wouldn’t get features such as the title or collapse, and Markdown inside the admonition probably would not be rendered.

1 Like

Thank you! I’ll see if I can give this a try, I’ve almost never used CSS so I’ll have to figure that out first.

I was looking for a way to fold embed links. This plugin solved it me for that and can do much more. Thank you

Hello! Your plugin looks amazing on my notes, and I use it everywhere! It would be perfect if you could solve two issues I found:

A. Tags don’t seem to work inside admonition blocks. They are clickable in preview mode and brings up the search bar, but the note does not register these tags in the search window or the graph. I assume it’s because these tags are within code blocks. If this gets addressed, tag admonition windows would look awesome.

```ad-tags
#nonworkingtag

```.
#workingtag

B. This issue is a bit minor but, whenever I include collapse and title on top of the admonition content, any checkboxes I add below them act weirdly. In preview mode, the location of the tickbox shifts when I try to click them. For example, I try to click on one checkbox, the one before gets ticked and so on. This issue does not occur if I leave out title and collapse.

```ad-actions
title: actions

- [x] This gets ticked instead
- [ ] I clicked on this but it didn't tick
```.

```ad-actions

- [ ] This ticks fine
- [ ] This ticks fine too
```.

Yeah, unfortunately this is due to the code blocks. I did release an update that allows for creating admonitions without codeblocks, but its rather limited at the moment - see here.

Interesting, thanks for letting me know. Adding in the click functionality is a little hacky - it is not natively supported in codeblocks - so I must be doing something incorrectly. Would you mind opening an issue on the repo for this?

2 Likes

Thanks for the heads up!

Sure, looking forward to the updates :grinning: your work is fantastic

admonition

I see strange triangle on top of collapsible admonition (see screenshot). There are not any somewhat on documentations’s screenshotes. How can I remove this unnessesary triangle on collapsible admonition?

This typically occurs because of an mismatched electron version in your Obsidian installation. Please download the latest installer and re-install Obsidian. Your settings etc will carry over.