Skip to content

Latest commit

 

History

History
268 lines (208 loc) · 6.1 KB

File metadata and controls

268 lines (208 loc) · 6.1 KB

Documentation Setup Summary

✅ What Was Created

A complete documentation site similar to Venvalid's documentation has been created for the FastAPI Environment Banner project.

📁 Files Created

Configuration

  • mkdocs.yml - Main MkDocs configuration with Material theme
  • .github/workflows/docs.yml - GitHub Actions workflow for automatic deployment

Documentation Content

  • docs/index.md - Home page (Get Started)
  • docs/installation.md - Installation guide
  • docs/usage/quick-start.md - Quick start guide
  • docs/usage/configuration.md - Configuration options
  • docs/usage/examples.md - Usage examples (10 examples)
  • docs/api/config.md - EnvBannerConfig API reference
  • docs/api/middleware.md - EnvBannerMiddleware API reference
  • docs/api/swagger.md - setup_swagger_ui API reference
  • docs/contributing.md - Contributing guide

Helper Documentation

  • DOCUMENTATION.md - Guide for building and maintaining documentation

📦 Dependencies Added

Updated pyproject.toml with documentation dependencies:

[project.optional-dependencies]
docs = [
    "mkdocs>=1.5.0",
    "mkdocs-material>=9.5.0",
    "pymdown-extensions>=10.7.0",
]

🎨 Documentation Features

Theme & Design

  • 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

Content Features

  • 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

Navigation Structure

Get Started (Home)
Installation
Usage
  ├─ Quick Start
  ├─ Configuration
  └─ Examples
API Reference
  ├─ EnvBannerConfig
  ├─ EnvBannerMiddleware
  └─ Swagger Setup
Contributing

🚀 How to Use

Local Development

  1. Install dependencies:

    uv pip install ".[docs]"
  2. Serve documentation locally:

    uv run mkdocs serve
  3. Open browser:

    http://127.0.0.1:8000
    

Build Documentation

uv run mkdocs build --strict

Output will be in the site/ directory.

🌐 Deployment

Automatic Deployment (GitHub Pages)

The documentation will be automatically deployed to GitHub Pages when you:

  1. Push changes to the main branch
  2. The GitHub Actions workflow (.github/workflows/docs.yml) will run
  3. Documentation will be built and deployed to gh-pages branch
  4. Site will be available at: https://pinnlabs.github.io/fastapi-env-banner/

Setup Required

To enable GitHub Pages:

  1. Go to repository SettingsPages
  2. Under Source, select GitHub Actions
  3. Save the settings

That's it! The workflow will handle the rest.

Manual Deployment

If needed, you can manually deploy:

uv run mkdocs gh-deploy

📝 Documentation Content

Home Page (index.md)

  • About the project
  • Why use it
  • Installation instructions
  • Quick example
  • Usage guide
  • Supported environments
  • Advanced options
  • Environment detection

Installation Guide

  • Requirements
  • Installation methods (pip, uv, from source)
  • Development installation
  • Verification steps

Usage Section

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

API Reference

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

Contributing Guide

  • Getting started
  • Development setup
  • Running tests
  • Code style
  • Testing guidelines
  • Pull request process
  • Bug reports
  • Feature requests

🎯 Similar to Venvalid

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

🔧 Customization

Change Colors

Edit mkdocs.yml:

theme:
  palette:
    primary: green  # Change to your color
    accent: green   # Change to your color

Add New Pages

  1. Create Markdown file in docs/
  2. Add to navigation in mkdocs.yml:
    nav:
      - Your Page: your-page.md

Modify Content

Edit any .md file in the docs/ directory. Changes will be reflected immediately when running mkdocs serve.

✨ Next Steps

  1. Review the documentation locally
  2. Make any adjustments to content or styling
  3. Commit and push to GitHub
  4. Enable GitHub Pages in repository settings
  5. Wait for deployment (check Actions tab)
  6. Share the documentation link!

📚 Resources


Documentation is now ready to use! 🎉

The site is currently running at: http://127.0.0.1:8000