`Quote syntax` based extensive `admonition syntax` support propose

Use case or problem

Users have need to add various container based blocks into their article.

An extensive syntax called admonition did a adequate effect, it’s syntax is like that:

!!! note "Jaycee Chow's diary"
    Today is a sunny day. 

??? note
    This is collapsed by default. 

!!! abstract
    Long long time ago, ......

A existing obsidian plugin provide such syntax:

```admonition-note
The note message
```

But, in a normal Markdown editor, the above syntax don’t have a good downward compatibility.

In the meantime, many users do have urge need of a way to create admonition or other container based blocks.

Proposed solution

The quote syntax is naturally a container syntax of Markdown, a suggested solution is to introduce a quote syntax based extension syntax, for example:

> [info] Alice's *reminder*
> 
> Don't forget to take the garbage before going outside. 


> [warning] ==Warning Title==
> 
> This is a warning admonition block. 


> [danger] A danger reminder
> 
> > [info] note
> > 
> > Indent note


> [info|hide] The message below is **collapsed**. 
> 
> This part is collapsed by default, because of the 'hide' keyword. But you can unfold it. 

> [note|center] A poem
> 
> 床前明月光,
> 疑是地上霜。
> 举头望明月,
> 低头思故乡。
> 
> (This part is ought to be center-aligned, a better way to show a poem)

> [box|red] This part should be within a red box frame
> 
> It can highlight some important paragraphs. 

The preview of the above could look like that:

A great advantage of this syntax is that it have a great downward compatibility to normal Markdown Editor. Even if your editor don’t have special support of this syntax, it still can show the message as a quote block, just less colors and styles:


[info] Alice’s reminder

Don’t forget to take the garbage before going outside.

[warning] ==Warning Title==

This is a warning admonition block.

[danger] A danger reminder

[info] note

Indent note

[info|hide] The message below is collapsed.

This part is collapsed by default, because of the ‘hide’ keyword. But you can unfold it.

[note|center] A poem

床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。

(This part is ought to be center-aligned, a better way to show a poem)

[box|red] This part should be within a red box frame

It can highlight some important paragraphs.


See, all the indent, container, inline style were all kept (just less colorful styles). Even if in a plaintext editor, you can easily tell that part is in a container block.

At the end

This topic is meant to open a discussion of this new syntax, details of it’s implementation ought to be explored. I think it’s pretty innovative.

1 Like

I am trying to use Admonition blocks, which look very pretty, inside the Daily Notes, and then trying to have them as Checklist items, so the Rollover plugin would be able to move all Admonition blocks. But it does not work totally well, because I cannot add a title to the Admonition block. A title needs to be on the next line, and if formatted as a checklist, breaks the Admonition.

This works:

  • [ ] ```ad-note
  • [ ] ==EARTH TEAM =======
  • [ ] Salesforce backups
  • [ ] wested contract
  • [ ] ==U4I ============

This does not wotk. Can it be made to work?

  • [ ] ```ad-note
    tittle: Earth Team
  • [ ] ==EARTH TEAM =======
  • [ ] Salesforce backups
  • [ ] wested contract
  • [ ] ==U4I ============

A quotation, alert, call-out or whatever you wanna call it, syntax will be added in 0.14. it is inspired by the alert syntax in Microsoft docs that admonition also uses now. It will work in obsidian publish too.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.