Documentation
This guide covers how to contribute to the react-native-nitro-device-info documentation.
Local Development
Prerequisites
- Node.js 22 or higher
- Yarn package manager
Running Locally
- Navigate to the docs directory:
- Install dependencies:
- Start the development server:
The documentation site will be available at http://localhost:5173.
Building for Production
To build the documentation for production:
The built files will be output to docs/doc_build.
Documentation Structure
Writing Documentation
Markdown Guidelines
- Use GitHub-flavored Markdown
- Include code examples with proper syntax highlighting
- Add TypeScript types for API examples
- Use backticks around
library-namein prose - Link to related pages using relative paths
Code Examples
Adding New Pages
- Create a new
.mdfile in the appropriate directory - Update
.rspress/config.tsto add the page to navigation:
Deployment
Documentation is automatically deployed to GitHub Pages when changes are merged to the main branch.
Automated Workflows
Pull Request Validation
When you open a PR with documentation changes, the docs-validation.yml workflow will:
- Install dependencies
- Build the documentation
- Upload build artifacts for review
This ensures all documentation builds successfully before merging.
Production Deployment
When changes are merged to main, the docs-deploy.yml workflow will:
- Build the documentation
- Deploy to GitHub Pages
- Make the site available at:
https://l2hyunwoo.github.io/react-native-nitro-device-info/
Manual Deployment
If needed, you can manually trigger a deployment by pushing to the main branch:
Configuration
RSPress Config
The main configuration is in .rspress/config.ts:
Key configuration options:
base: The base path for GitHub Pages deploymentthemeConfig.nav: Top navigation bar itemsthemeConfig.sidebar: Sidebar navigation structurelocales: Internationalization settings (English and Korean)
Troubleshooting
Build Fails Locally
If the build fails:
- Clear the cache:
- Check for syntax errors in Markdown files
- Ensure all internal links are valid
Changes Not Appearing
- Clear your browser cache
- Check that the dev server restarted after file changes
- Verify the file is in the correct directory structure
GitHub Pages Not Updating
- Check the Actions tab in GitHub for workflow status
- Verify GitHub Pages is enabled in repository settings
- Ensure the workflow has proper permissions (configured in
docs-deploy.yml)
Best Practices
- Keep it concise: Users prefer shorter, focused documentation
- Show, don't tell: Use code examples liberally
- Update related pages: If you change an API, update all relevant docs
- Test locally: Always build and preview before submitting a PR
- Check links: Ensure all internal and external links work
- Mobile-friendly: RSPress is responsive, but test on different screen sizes
Getting Help
If you need help with documentation:
- Check the RSPress documentation
- Open an issue on GitHub
- Ask in pull request comments
