source.config.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { rehypeCodeDefaultOptions } from "fumadocs-core/mdx-plugins";
  2. import { remarkInstall } from "fumadocs-docgen";
  3. import { defineConfig, defineDocs } from "fumadocs-mdx/config";
  4. import { transformerTwoslash } from "fumadocs-twoslash";
  5. export default defineConfig({
  6. mdxOptions: {
  7. rehypeCodeOptions: {
  8. langs: [
  9. // FIXME(#403): If a popup itself contains a code fence in any language other than
  10. // `ts`, the Shiki highlighter will throw an error that it hasn't loaded that
  11. // language. Until we figure this out, preemptively load the `js` language.
  12. "js",
  13. ],
  14. themes: {
  15. dark: "github-dark",
  16. light: "github-light",
  17. },
  18. transformers: [...(rehypeCodeDefaultOptions.transformers ?? []), transformerTwoslash()],
  19. },
  20. remarkPlugins: [() => remarkInstall({ persist: { id: "package-install" } })],
  21. },
  22. });
  23. export const docs = defineDocs({
  24. dir: "content/docs",
  25. });
  26. export const api = defineDocs({
  27. dir: "content/api",
  28. });
  29. export const guides = defineDocs({
  30. dir: "content/guides",
  31. });