nuxt-themes / docus

Write beautiful documentations with Nuxt and Markdown.
https://docus.dev
MIT License
1.54k stars 157 forks source link

feat: Handle inline nodes attributes #408

Closed atinux closed 3 years ago

atinux commented 3 years ago

A crazy idea, would that be possible?

Hello (World){.text-primary-500}!

And it will render

Hello <span class="text-primary-500">World</span>!

Also, the question about combination might be tricky:

Hello **(World){.text-primary-500}**!
farnabaz commented 3 years ago

Surely it is possible. It requires create an extension for Micromark

Also, the question about combination might be tricky:

Combinations is Micromark is straight forward and with a some consideration we can make it work.

atinux commented 3 years ago

That is nice to read this :smile:

farnabaz commented 3 years ago

What if instead of parentheses we use square brackets for text? This will improve visual consistency of markdown data since links use [] and inline components use [] for slot.

Use [World]{.text-primary-500} instead of (World){.text-primary-500}

atinux commented 3 years ago

I really like using Square brackets too, great idea!