Extending markdown

I wanted to use small caps for something I was working on, and I realized there isn’t markdown syntax for small caps (!). I was wondering how I could fix this. I am not a developer by trade, but I have a tiny bit of experience. In short, my question is: How do I add small caps to Obsidian?

Post Script:
If it is helpful for anyone, I was going to use ::word:: to signify small caps :smile:

Maybe, if you don’t use highlights for other things, you could use CSS to turn all highlights (like ==this==) into small-caps?

.markdown-rendered mark {
background-color: transparent !important; /* remove highlight background */
font-variant: small-caps !important; /* force small-caps */

If u intend to develop a plugin to support that, I strongly suggest to avoid double colon :: :: as it is widely used for dataview inline key-value pair. It might accidentally register a key pair for the last bit of the double colon

I assume u might’ve possible syntax from wider markdown community, so i suggest follow those suggestions like ^^ ^^ or perhaps new combination like ^* *^.

Note that the above might take a substantial effort to implement in obsidian as u would have to define a new combination not recognised by obsidian (you would have to mess with codemirror and all). If u want easier implementation, use combination of emphasis and inline code i.e. *' '* replace the single quote with backtick. Other combinations might interrupt some themes formatting

What are you using small caps for? Does something already exist for that purpose? For example, if small caps were for book titles, I’d use the HTML cite element for that and use CSS to style it as small caps.

If there’s nothing suitable I’d use an HTML span with a class.

Markdown is about structure, not presentation. So if you really want to extend Markdown (and I would not rush to do that), extend it to cover the structural purpose the small caps represent, not the presentational detail of small caps (that’s what CSS is for).

1 Like