Edit documentation
OpenGateLLM uses Docusaurus to serve its documentation.
Installing and running the project
Documentation installation
Before you begin, make sure you have:
- Node.js (version 18+ recommended)
- npm (or yarn/pnpm) installed
Check your versions with:
node -v
npm -v
Install dependencies:
cd docs/
npm install
Running the development server
Start the local development server:
npm run start
This will:
- Launch a development server at http://localhost:3000/
- Hot-reload changes as you edit files
Building for production
You can build the website with:
npm run build
The output will be in the build/ folder, which you can deploy to any
static hosting service (Vercel, Netlify, GitHub Pages, etc.).
Project structure overview
The most importants files in the project are:
docs/
├─ blog/ # Blog posts
├─ docs/ # Documentation pages
├─ src/ # Custom React components, pages, styles
│ ├─ components/ # Reusable React components
│ ├─ css/ # Custom Css
│ ├─ pages/ # Custom pages (e.g., about.js)
│ └─ theme/ # Custom theme
├─ static/ # Static assets (images, files)
│ └─ img/ # Images used in the markdown in docs
├─ docusaurus.config.js # Main configuration file
└─ sidebars.js # Defines sidebar navigation
Updating the documentation
Editing the markdown
You can add or modify content to the documentation by adding or modifying the files inside the docs docs/ folder.
You can use either .md or mdx files.
Updating the documentation sidebar
If you add a file, you'll need to add your page to the sidebar.
In docs/sidebars.ts, add an item to tutorialSidebar:
- if your content is a single markdown (named
my_documentation.md) outside a category, add:
{
type: 'doc',
id: 'my_documentation',
}
- if your content is a markdown (named
my_documentation.md)inside a category (named my_category):
{
type: 'category',
label: 'my_category',
items: [
'my_documentation'
],
}
Warning: If your markdown (
my_documentation.md) is in a subdirectory indocs(for instancefunctionalities), the id of your page will befunctionalities/my_documentation
Customizing configuration
Open docusaurus.config.js to change:
- Site title & tagline
- Navbar & footer links
- Theme colors
- Deployment settings
Automatic documentation generation
Some documentation is automatically generated from the codebase. Please do not edit the generated documentation files.
The following script is used to generate documentation:
-
scripts/docs/generate_configuration_documentation.pyGenerates the configuration documentation from the configuration schema with the configuration header. The output is stored in the /docs/getting-started/configuration.md file.
-
scripts/docs/convert_notebooks_to_docs.pyConverts the notebooks in the /docs/tutorials folder to markdown files in the /docs/docs/guides folder.
Deploying documentation
When a file is modified in the docs folder, a new docker image of the documentation website is created here and the official documentation is automatically updated.