Sphinx-RapiDoc
A Sphinx extension that integrates RapiDoc to render beautiful, customizable, and interactive API documentation from OpenAPI/Swagger specifications.
Features
- 🚀 Quick and easy integration with Sphinx documentation
- 🎨 Customizable themes (light/dark)
- 🔄 Multiple rendering styles (read/view/focused)
- 🔒 Support for authentication
- ⚡ Interactive API testing interface
- 📱 Responsive design
- 🔍 Search functionality
- 📖 Support for OpenAPI v2.0 (Swagger) and v3.0
Installation
Install the package using pip:
pip install sphinx-rapidoc
Or install directly from GitHub for the latest version:
pip install git+https://github.com/TirthS24/sphinx_rapidoc
Quick Start
-
Add
sphinx_rapidocto your Sphinx extensions inconf.py:extensions = [ # ... your other extensions 'sphinx_rapidoc' ]
-
Create a new RST file (e.g.,
api.rst) with the RapiDoc directive:API Documentation ================ .. rapidoc:: :spec-url: https://api.example.com/openapi.json :theme: light :render-style: view
-
Include your RST file in
index.rst:.. toctree:: :maxdepth: 2 :caption: Contents: api
-
Build your documentation:
make html
Configuration Options
Directive Options
| Option | Description | Default | Values |
|---|---|---|---|
spec-url |
URL to OpenAPI/Swagger specification | None | Valid URL |
theme |
UI theme | light |
light, dark |
render-style |
Documentation rendering style | view |
view, read, focused |
Examples
Basic Usage
.. rapidoc::
:spec-url: http://127.0.0.1:5500/src/petstore.yml
:theme: light
:render-style: view
Dark Theme with Read Style
.. rapidoc::
:spec-url: http://127.0.0.1:5500/src/petstore.yml
:theme: dark
:render-style: read
Screenshots
Endpoint and Authentication Sections
Sample GET Request Interface
Requirements
- Python 3.9 or higher
- Sphinx 2.0 or higher
- Valid OpenAPI/Swagger specification (JSON or YAML format)
- Web browser with JavaScript enabled
Common Issues and Solutions
CORS Errors
If you encounter CORS errors, ensure that:
- Your API specification URL is accessible from the hosted server
- The server hosting your API specification has appropriate CORS headers
- You're using HTTPS if your documentation is hosted on HTTPS
Specification Not Loading
- Verify that your specification URL is publicly accessible
- Check if the URL returns valid JSON/YAML in OpenAPI/Swagger format
- Ensure your specification follows OpenAPI standards
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Support
If you encounter any issues or have questions, please:
- Check the Common Issues section
- Open an issue on GitHub
- Contact the maintainers
Metadata
Release files for sphinx-rapidoc 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sphinx_rapidoc-0.1.2.tar.gz | 225.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinx_rapidoc-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 451.1 kB
Release files / sphinx_rapidoc-0.1.2.tar.gz
| Download URL | sphinx_rapidoc-0.1.2.tar.gz |
|---|---|
| Size | 225.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
295601d4f0150c4e76205869b84c5eeeb0ca39de973dbe1632de9c8896d1e6ea
|
|
BLAKE2b-256 checksum How to use checksums |
503abcc1caf6cee43e5c759916c1860a71b4f011c5f604518b45940b639f9e91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Release files / sphinx_rapidoc-0.1.2-py3-none-any.whl
| Download URL | sphinx_rapidoc-0.1.2-py3-none-any.whl |
|---|---|
| Size | 225.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e31df48a4ea778a447a62f7588dad5bbb0a06ea2ab6ae54f1e31c5135112ce5d
|
|
BLAKE2b-256 checksum How to use checksums |
8c65e583154b86879d0899638ac796bfdc558a7ee18c972f81c45b11cf3057a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Security for sphinx-rapidoc 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.