import type { Config } from "@docusaurus/types";
import { themes as prismThemes } from "prism-react-renderer";

// If your content lives in docs/src, set DOCS_PATH='src'; else '.'
const DOCS_PATH =
  process.env.DOCS_PATH || (require("fs").existsSync("src") ? "src" : ".");

const config: Config = {
  title: "Miden Debugger",
  url: "http://localhost:3000",
  baseUrl: "/",
  trailingSlash: false,

  // Minimal classic preset: docs only, autogenerated sidebars.
  presets: [
    [
      "classic",
      {
        docs: {
          path: DOCS_PATH,
          routeBasePath: "/",
          sidebarPath: "./sidebars.ts",
          remarkPlugins: [require("remark-math")],
          rehypePlugins: [require("rehype-katex")],
          versions: {
            current: {
              label: "unstable",
            },
          },
        },
        blog: false,
        pages: false,
        theme: {
          customCss: "./styles.css",
        },
      },
    ],
  ],

  themeConfig:
    /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
    {
      colorMode: {
        defaultMode: "light",
        disableSwitch: true,
      },
      prism: {
        theme: prismThemes.oneLight,
        darkTheme: prismThemes.oneDark,
        additionalLanguages: ["rust", "toml", "yaml", "bash"],
      },
      navbar: {
        title: "Miden Debugger",
        items: [
          {
            href: "https://github.com/0xMiden/miden-debug",
            label: "GitHub",
            position: "right",
          },
        ],
      },
    },
};

export default config;
