systemphil / symposia

Symposia is a philosophy course platform🏺
https://symposia.sphil.xyz
Apache License 2.0
9 stars 1 forks source link

Admonition directive not carried over from editor to the compiled mdx #34

Closed Firgrep closed 1 year ago

Firgrep commented 1 year ago

The fancy "admonitions" in the editor are not displayed on the user rendered page. I think we need to tailor the compiler. I've added remark-directive which seems to parse the ::: tags. but it loses the specific admonition. Since this is a style provided by the mdx editor, I think we have to dig it up from there and relay it to the compiler such that the user rendered page sees exactly what is seen on editor.

https://github.com/mdx-editor/editor/blob/main/src/directive-editors/AdmonitionDirectiveDescriptor.tsx https://github.com/remarkjs/remark-directive

Firgrep commented 1 year ago

Took quite a bit of effort but we got there in the end, thanks to awesome help from ChristianMurphy here! Learned quite a bit about the mdx compilation process and this will be useful when we want to tinker with its features some more in the future.

https://github.com/orgs/mdx-js/discussions/2355#discussioncomment-7139230