Skip to content

feat(api): updates reference documentation #205

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions docusaurus.config.js → docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const {themes} = require('prism-react-renderer');
import type { ScalarOptions } from '@scalar/docusaurus'
import type { Config } from '@docusaurus/types'
import { themes } from 'prism-react-renderer'
import fs from 'fs'
const lightCodeTheme = themes.okaidia;
const darkCodeTheme = themes.okaidia;

const redocusaurus = [
"redocusaurus",
{
// Plugin Options for loading OpenAPI files
specs: [
{
spec: "openapi.yaml",
route: "/api/",
},
],
// Theme Options for modifying how redoc renders them
theme: {
// Change with your site colors
primaryColor: "#1890ff",
},
},
];
// Read the openapi.yaml file
const specFile = fs.readFileSync('./openapi.yaml', 'utf8')

/** @type {import('@docusaurus/types').Config} */
const config = {
const config: Config = {
title: "Mistral AI Large Language Models",
tagline: "Documentation for the deployment and usage of Mistral AI's LLMs",
favicon: "img/favicon.ico",
Expand Down Expand Up @@ -67,11 +53,13 @@ const config = {
},
blog: false,
theme: {
customCss: require.resolve("./src/css/custom.css"),
customCss: [
require.resolve("./src/css/custom.css"),
require.resolve("./src/css/api-reference.css"),
],
},
}),
],
redocusaurus,
],

themeConfig:
Expand Down Expand Up @@ -110,7 +98,6 @@ const config = {
position: "left",
activeBaseRegex: "^/(?!api)",
},
{ to: "/api/", label: "API", position: "left" },
{
href: "https://github.com/mistralai/",
label: "GitHub",
Expand Down Expand Up @@ -171,7 +158,22 @@ const config = {
respectPrefersColorScheme: true,
},
}),
plugins: [require.resolve('docusaurus-lunr-search')],
plugins: [
require.resolve('docusaurus-lunr-search'),
[
'@scalar/docusaurus',
{
label: 'API',
route: '/api',
configuration: {
spec: {
content: specFile,
},
hideDarkModeToggle: true,
},
} as ScalarOptions,
],
],
};

module.exports = config;
export default config;
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@
"@docusaurus/core": "3.5.2",
"@docusaurus/preset-classic": "3.5.2",
"@docusaurus/theme-common": "3.5.2",
"@docusaurus/types": "^3.7.0",
"@easyops-cn/docusaurus-search-local": "^0.44.5",
"@mdx-js/react": "^3.0.1",
"@scalar/docusaurus": "^0.4.211",
"clsx": "^1.2.1",
"docusaurus-lunr-search": "^3.4.0",
"lunr": "^2.3.9",
"prism-react-renderer": "^2.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"redocusaurus": "^2.1.1"
"react-dom": "^18.3.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.2.1",
Expand Down
Loading