Overview
Comprehensive guide on how to contribute to our documentation
Contributions to the documentation are welcome! This guide explains how to contribute to the LibreChat documentation by writing and formatting new documentation. Our website is built with Nextra 3 and our docs use the .mdx format (augmented markdown).
When to Write a Doc vs. a Blog Post
Blog vs Docs
Consider publishing a blog post when a document is an extension of an existing one, relates to a specific situation, or requires external maintenance (features not actively used by the team).
See: Contributing to Blog
Getting Started
-
Fork the LibreChat Documentation repository: https://github.com/LibreChat-AI/librechat.ai
-
Create a branch on your fork, name it properly, and link it to the original repository.
Replace
branch-nameandusernamewith your details
Creating New Documents
To create a new document:
- Use the
.mdxfile extension (see MDX documentation for more info). - Name files using lowercase letters and underscores (e.g.,
documentation_guidelines.mdx). - Place new documents in the relevant folder/sub-folder under
./docs. - Add the document to the table of contents in the
_meta.tsfile of the folder where your document is located. If you don't add it, it will be alphabetically sorted after the ordered docs.
Markdown Formatting Guidelines
- Use headings and subheadings with
#,##, and###.- Use
#for the document title (only one main title per document is allowed). - Use
##for main sections. - Use
###for sub-sections within a section.
- Use
- Use
**to make text bold and highlight important information (do not use in place of a heading). - Use URL paths to link to other documents (e.g.,
/docs/documentationpoints the current doc). - You can use HTML, TS, and JS to add additional features to a document.
- Ensure any HTML has closing tags (e.g.,
<img src="" />or<a href="link"></a>). - Do not use HTML comments; instead, use Markdown comments only if the text is actually hidden.
Docs Resources
Docs Resources
See some integrated components examples:
For more information, refer to:
Document Metadata
Add metadata to the header of your document using the following format:
Note: The
ogImagefield is optional and can be omitted altogether. It is used to specify the image that will be displayed when sharing your document on social media platforms.
Assets
Whenever possible, upload assets (e.g., images) to GitHub instead of storing them in the /public folder. This helps keep your repository organized and makes it easier to manage your assets.
Images
Note: In the following example:
- I provided screenshots for both light and dark mode.
- I used
Image from 'next/image'which gave me 4x improvement on the image file size for better performance.
see the following example in action here: User Guides
How to Upload Images and Videos on GitHub
Test the Docs
Before you submit
Review carefully before submitting your PR
Before submitting a PR for your blog post, always test to ensure everything looks and functions as intended.
Check the following:
- Your new document(s) for layout, accuracy and completeness
- The document's position in the Table of Contents (ToC)
- The image and link in your document
To test:
- Prepare the environment by running
pnpm install - Start the dev server with
pnpm dev - Test the build by running
pnpm buildfollowed bypnpm start
How is this guide?