Alternate Syntax for Codeblock Plugins

Use case or problem

The problem is that a bunch of new plugins are coming out that do some nifty stylings, but because they leverage code blocks, the contents don’t show up in things like the Linked Mentions or the Graph.

Proposed solution

It would be nifty if plugins like dataview and admonition had a different custom syntax that could optionally be used (for backwards compatibility / to avoid breaking things for plugins, and for the people who prefer their admonition links not show up in the graph), something like \\\ or whatever, kind of like how comments %% style got added (allows links to still show up in the graph) instead of changing the behavior of <!-- comments (which cause links to not show up on the graph).

Current workaround (optional)

Right now you have to put the tags elsewhere. It’s also a reason the dataview inline :: metadata got created, at least partially (since links don’t function in the YAML, some of us are doing inline metadata inside of the %% style comments).

Related feature requests (optional)

There is also a request for the Ability to create Filelinks/Tags for the Graph inside Codeblocks, but I personally think that doing it that way will not happen, because code blocks aren’t defined by obsidian but rather mark down.

11 Likes

This seems like a non-destructive solution to an issues that’s, as Eleanor says, cropping up with more and more plugins. +1 to this line of thinking as a way to please many and displease few.

5 Likes

I think one way of formalizing this is to have an obsidian code block. Something like this:

```obsidian/admonition
[[links]]
#tags
```

the obsidian part will tell obsidian to parse it (and not ignore it or let plugins handle it entirely). The part after the / would allow a plugin to recognize it.

I think this would fit within the markdown way of doing things.

2 Likes

+1

More than needed feature!

2 Likes

+1

this would open new possibilities for plugins.

1 Like

+1

Could be a game changer for some plugins already out (and many to come) that are heavily penalized by the codeblock as is.

1 Like

+1
admonition links are well rendered and work properly but like you said because they are in code blocks, there are not correctly processed by features such as Linked mentions

For things like admonitions I would suggest Pandoc fenced divs syntax:

::: note
This is a note.
:::

Related:

1 Like