Deployment

Viewing Locally

Method 1: Direct File Access

# Windows
start build\html\index.html

# macOS
open build/html/index.html

# Linux
firefox build/html/index.html

Method 2: Python HTTP Server

python -m http.server 8000 --directory build/html

Visit: http://localhost:8000

Method 3: Live Server (VS Code)

  1. Install “Live Server” extension in VS Code

  2. Right-click build/html/index.html

  3. Select “Open with Live Server”

Production Deployment

Option 1: Web Server (Nginx/Apache)

Copy the build/html/ directory to your web server:

# Nginx
cp -r build/html/* /var/www/html/docs/

# Apache
cp -r build/html/* /var/www/html/docs/

Option 2: GitHub Pages

# Push to gh-pages branch
git add build/html/
git commit -m "Update documentation"
git subtree push --prefix build/html origin gh-pages

Option 3: Read the Docs

  1. Push your repository to GitHub

  2. Sign up at readthedocs.org

  3. Connect your repository

  4. Automatic builds on each push

Option 4: Docker

Create Dockerfile:

FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN make html
EXPOSE 8000
CMD ["python", "-m", "http.server", "8000", "--directory", "build/html"]

Build and run:

docker build -t api-docs .
docker run -p 8000:8000 api-docs

Best Practices

  • Always build locally before deploying

  • Test in all supported browsers

  • Verify mobile responsiveness

  • Check all links are working

  • Test language switching functionality