Adding New Code Examples
Contribution Guidelines for Code Examples
- Submissions must be written in English.
- Document your example as thoroughly as possible.
- Ensure your code works and has been properly tested.
We reserve the right to:
- Modify your submission after it is submitted.
- Remove your submission if necessary.
Creating a New Code Example
1. Fork this repository
2. Clone your fork and cd into the project directory
3. Install VitePress
You can find VitePress prerequisites in the official documentation.
sh
npm add -D vitepress@nextsh
pnpm add -D vitepress@nextsh
yarn add -D vitepress@next vuesh
bun add -D vitepress@next4. Add Your Code Example
4.1 Create the example file
- Create a new file in
/docs/examplesnamed after the programming language. - The filename must end with
.md. - Include at least two different ways to make API calls.
4.2 Add the example to the sidebar
- Open
/docs/.vitepress/config.mts. - Locate the "Code Examples" section in the sidebar.
- Add your new file to the list.
- Keep the list in alphabetical order by programming language.
5. Start the Development Server
Before creating a pull request, verify locally that your changes did not break anything.
sh
npm run devsh
pnpm run devsh
yarn devsh
bun run dev6. Create a Pull Request
Submit a pull request to the original repository.