import type * as Preset from '@docusaurus/preset-classic'; import type { Config } from '@docusaurus/types'; import { version } from '../package.json'; import { githubDark } from '../src/themes/githubDark'; import { githubLight } from '../src/themes/githubLight'; import siteIndex from './src/plugins/siteIndex'; import { prismThemeFrom } from './src/prism/fromEditorTheme'; const config: Config = { title: 'React Native CodePad', tagline: 'A native code editor for React Native, with one C++ core shared by Android and iOS, tree-sitter highlighting and a Nitro binding. No WebView.', favicon: 'img/favicon.svg', url: 'https://reactnativecodepad.pages.dev', baseUrl: '/', trailingSlash: true, organizationName: 'SectionTN', projectName: 'react-native-codepad', onBrokenLinks: 'throw', markdown: { hooks: { onBrokenMarkdownLinks: 'throw', }, }, i18n: { defaultLocale: 'en', locales: ['en'], }, presets: [ [ 'classic', { docs: { path: 'docs', routeBasePath: '/', sidebarPath: './sidebars.ts', editUrl: 'https://github.com/SectionTN/react-native-codepad/edit/main/website/', showLastUpdateTime: true, }, blog: false, sitemap: { lastmod: 'date', changefreq: null, priority: null, ignorePatterns: ['/search/**'], }, theme: { customCss: './src/css/custom.css', }, } satisfies Preset.Options, ], ], customFields: { version }, plugins: [ siteIndex, [ 'docusaurus-plugin-llms', { generateLLMsFullTxt: true, docsDir: 'docs', title: 'React Native CodePad', description: 'A native code editor for React Native, with one C++ core shared by Android and iOS, tree-sitter highlighting and a Nitro binding. No WebView.', }, ], ], themes: [ [ '@easyops-cn/docusaurus-search-local', { hashed: true, indexBlog: false, docsRouteBasePath: '/', highlightSearchTermsOnTargetPage: false, }, ], ], themeConfig: { image: 'img/og.png', metadata: [ { name: 'description', content: 'A native code editor for React Native, with one C++ core shared by Android and iOS, tree-sitter highlighting and a Nitro binding. No WebView.', }, ], colorMode: { defaultMode: 'dark', respectPrefersColorScheme: true, }, prism: { theme: prismThemeFrom(githubLight), darkTheme: prismThemeFrom(githubDark), additionalLanguages: ['bash', 'json', 'kotlin', 'swift', 'groovy', 'ruby', 'diff', 'java'], magicComments: [ { className: 'theme-code-block-highlighted-line', line: 'highlight-next-line', block: { start: 'highlight-start', end: 'highlight-end' }, }, { className: 'code-block-diff-add', line: 'diff-add', block: { start: 'diff-add-start', end: 'diff-add-end' }, }, { className: 'code-block-diff-remove', line: 'diff-remove', block: { start: 'diff-remove-start', end: 'diff-remove-end' }, }, ], }, navbar: { items: [ { to: '/start/introduction/', label: 'Docs', activeBaseRegex: '^/(start|internals)/' }, { to: '/guides/languages/', label: 'Guides', activeBaseRegex: '^/guides/' }, { to: '/reference/props/', label: 'Reference', activeBaseRegex: '^/reference/' }, { to: '/#roadmap', label: 'Roadmap', activeBaseRegex: '^$' }, ], }, footer: { links: [ { title: 'Docs', items: [ { label: 'Getting started', to: '/start/introduction/' }, { label: 'Guides', to: '/guides/languages/' }, { label: 'Reference', to: '/reference/props/' }, ], }, { title: 'Community', items: [ { label: 'GitHub', href: 'https://github.com/SectionTN/react-native-codepad' }, { label: 'Issues', href: 'https://github.com/SectionTN/react-native-codepad/issues' }, { label: 'Contributing', to: '/internals/contributing/' }, ], }, { title: 'More', items: [ { label: 'Roadmap', to: '/#roadmap' }, { label: 'Releases', href: 'https://github.com/SectionTN/react-native-codepad/releases', }, ], }, ], }, } satisfies Preset.ThemeConfig, }; export default config;