Expand the plugin surface by using MDX

Hi there,

First of all, awesome work! Obsidian looks and feels great :slight_smile:

I was first attracted to this project because I thought that using markdown documents was a brilliant idea. I already had a lot of notes in markdown so I didn’t have to migrate data to start getting value out of Obsidian. I love knowing that those are my notes and that because they are just markdown files they will be useful beyond the future of Obsidian.

That being said, I’m a bit concerned about the limitations of markdown. I see that Roam releases new “components” such as range sliders, but in order to extend obsidian with such features it would need to deviate from markdown. I see some extensions such as using marmaid by using ``` blocks, but I’m not sure that’s the best API for adding capabilities to markdown.

I’m writing this post to propose https://mdxjs.com, a superset of markdown that allows to embed JSX. Since it’s a superset (imagine what Typescript is to Javascript) it means that anyone that comes to Obsidian with their markdown notes will have a good experience.

This proposal is two-fold: On one hand Obsidian could expose the primitive components (https://mdxjs.com/table-of-components) which would allow for themes to go beyond CSS personalization. On the other hand, by having JSX, users could author components (such as the range slider) to extend markdown capabilities.

Thoughts?

29 Likes

I’ve wired up an Obsidian vault to a static site generator with a MDX Renderer and let me tell you it’s incredible what you can do. Basically Wordpress-style shortcodes that = React components.

Agree with the author that there is potential in BOTH importing a default components library via MDX and also allowing each user to author their own stuff.

10 Likes

Do you have anything you can share or demo?

Hey Bob, just seeing this now! I wrote a guide on building one here: Creating a DIY Digital Garden with Obsidian and Gatsby - DEV Community

4 Likes

Thanks much! I took a look and it’s promising for my use case. Much appreciated.

Thanks for a wonderful tutorial. I’ve been meaning to set up a garden on my personal site for a while and your post is a great start.

How are you working with MDX files in Obsidian?

I’ve found a little downloaded community plugin for opening .mdx but when creating a new file from Obsidian it’s created with a regular .md extension.

2 Likes

3 years later, is there some development in this area, perhaps a more integrated solution or is the Gatsby setup the best we have?

1 Like