A complete documentation site similar to Venvalid's documentation has been created for the FastAPI Environment Banner project.
mkdocs.yml- Main MkDocs configuration with Material theme.github/workflows/docs.yml- GitHub Actions workflow for automatic deployment
docs/index.md- Home page (Get Started)docs/installation.md- Installation guidedocs/usage/quick-start.md- Quick start guidedocs/usage/configuration.md- Configuration optionsdocs/usage/examples.md- Usage examples (10 examples)docs/api/config.md- EnvBannerConfig API referencedocs/api/middleware.md- EnvBannerMiddleware API referencedocs/api/swagger.md- setup_swagger_ui API referencedocs/contributing.md- Contributing guide
DOCUMENTATION.md- Guide for building and maintaining documentation
Updated pyproject.toml with documentation dependencies:
[project.optional-dependencies]
docs = [
"mkdocs>=1.5.0",
"mkdocs-material>=9.5.0",
"pymdown-extensions>=10.7.0",
]- Material for MkDocs theme with green color scheme
- Dark/Light mode toggle
- Responsive design for mobile and desktop
- Navigation tabs for easy browsing
- Search functionality with suggestions
- Code syntax highlighting for Python
- Copy button on code blocks
- Admonitions for notes, warnings, tips
- Emoji support
- Tables for structured data
- Cross-references between pages
Get Started (Home)
Installation
Usage
├─ Quick Start
├─ Configuration
└─ Examples
API Reference
├─ EnvBannerConfig
├─ EnvBannerMiddleware
└─ Swagger Setup
Contributing
-
Install dependencies:
uv pip install ".[docs]" -
Serve documentation locally:
uv run mkdocs serve
-
Open browser:
http://127.0.0.1:8000
uv run mkdocs build --strictOutput will be in the site/ directory.
The documentation will be automatically deployed to GitHub Pages when you:
- Push changes to the
mainbranch - The GitHub Actions workflow (
.github/workflows/docs.yml) will run - Documentation will be built and deployed to
gh-pagesbranch - Site will be available at:
https://pinnlabs.github.io/fastapi-env-banner/
To enable GitHub Pages:
- Go to repository Settings → Pages
- Under Source, select GitHub Actions
- Save the settings
That's it! The workflow will handle the rest.
If needed, you can manually deploy:
uv run mkdocs gh-deploy- About the project
- Why use it
- Installation instructions
- Quick example
- Usage guide
- Supported environments
- Advanced options
- Environment detection
- Requirements
- Installation methods (pip, uv, from source)
- Development installation
- Verification steps
Quick Start:
- Basic setup
- Setting environment
- Supported values
- Manual configuration
- Minimal example
Configuration:
- All configuration parameters
- Default colors and texts
- Complete examples
- Environment-specific configuration
- Security considerations
Examples:
- 10 practical examples covering:
- Minimal setup
- Full customization
- Environment-based config
- Disable in production
- Custom colors
- Bottom banner
- Hide from Swagger
- Multiple environments
- Testing environment
- Dynamic text with version
EnvBannerConfig:
- Class definition
- All parameters with types and defaults
- Class methods (from_env, get_banner_color, get_banner_text)
- Environment enum
- Complete examples
EnvBannerMiddleware:
- Class definition
- How it works
- Behavior details
- Methods documentation
- Error handling
- Performance considerations
setup_swagger_ui:
- Function definition
- All parameters
- Usage examples
- How it works
- Behavior details
- Troubleshooting
- Getting started
- Development setup
- Running tests
- Code style
- Testing guidelines
- Pull request process
- Bug reports
- Feature requests
The documentation follows the same structure and style as Venvalid:
✅ Clean, modern design with Material theme ✅ Single-page navigation with sections ✅ Quick example on the home page ✅ Code-first approach with lots of examples ✅ Clear API reference with detailed documentation ✅ Easy navigation with tabs and sections ✅ Search functionality for finding content ✅ Dark mode support for comfortable reading ✅ Mobile responsive design
Edit mkdocs.yml:
theme:
palette:
primary: green # Change to your color
accent: green # Change to your color- Create Markdown file in
docs/ - Add to navigation in
mkdocs.yml:nav: - Your Page: your-page.md
Edit any .md file in the docs/ directory. Changes will be reflected immediately when running mkdocs serve.
- Review the documentation locally
- Make any adjustments to content or styling
- Commit and push to GitHub
- Enable GitHub Pages in repository settings
- Wait for deployment (check Actions tab)
- Share the documentation link!
Documentation is now ready to use! 🎉
The site is currently running at: http://127.0.0.1:8000