fumadocs
fumadocs copied to clipboard
Support turbo
Hey, as promised, a draft PR! Comments welcome :)
Notes
- I just converted the map config plugin to a plain ol' function
- added support for
['plugin-name', { ...options }]syntax - split the plugin resolution into two types, the 'input' phase contains the unresolved imports
- added a method to resolve these imports
- allowed overriding the
providerImportSource. I believe this will be mandatory when using turbo because we can't rely on webpack aliases - I have not ported / modified the search plugin
Questions:
- how do we communicate to the user that if using turbo you need to have serializable options? the types here will be funky. maybe 'createMDXTurbo' that just wraps the normal fn and adds the extra constraint?
- right now this syntax only supports default imports. I propose we ship it and come back to it if anyone needs that feature.
Still need to write docs but will come back to that once these Qs are resolved.
Testing
Here is a page on my deployed site https://github.com/arlyon/litehouse/blob/main/site/content/docs/plugins/index.mdx?plain=1#L21-L22 that uses both a remark plugin and a rehype language.
You can validate the webpack side still works here https://litehouse.arlyon.dev/docs/plugins and if you'd like to clone and build the repo you should be able to do that fairly trivially but here is also a screenshot.