# docs-index-generator

Refactored version of the original `generate-index.py`.

The generator is split structurally into focused Python modules, HTML/CSS/JavaScript source files, and PWA assets. The existing documentation index design and behavior are preserved.

## Structure

```text
generate-index.py
README.md
CONTEXT.md
generator/
├── __init__.py
├── cli.py
├── collector.py
├── generator.py
├── metadata.py
├── models.py
├── pwa.py
├── render.py
├── static/
│   ├── icons/
│   │   ├── icon-192.png
│   │   └── icon-512.png
│   ├── manifest.json
│   ├── script.js
│   ├── style.css
│   └── sw.js
└── templates/
    └── index.html
```

`render.py` contains the Python rendering logic only. The HTML template, CSS, and JavaScript are kept as separate source files and assembled into the generated `index.html` at runtime.

The generated site is also installable as a Progressive Web App (PWA) on supported browsers/devices. The manifest, service worker, and icons are copied into the output directory automatically. The PWA uses relative paths, so it works when hosted below a domain root, such as GitLab Pages project sites.

## Usage

```bash
./generate-index.py --source ../docs-public:public --output public
```
