Import from agentic-semantic-web/ into restructured repo: - 7 packs (apache, caddy, flask, hugo, nginx, pandoc, python) - shared error pages (403-503) - 17 lab experiments (boilerplate, charts, misc) - 31 example pages (charts, components, content, layout, vault) - 2 themes (garden, trentuna stub) - 4 docs (llms.txt, vocabulary, philosophy, agent-directive) - lineage.md (Pico/Open Props/Charts.css history) - Hugo mounts for lab/ and examples/ All agentic.css references updated to asw.css. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 lines
1.1 KiB
Markdown
35 lines
1.1 KiB
Markdown
# ASW Python Dev Server Pack
|
|
|
|
Drop-in replacement for `python -m http.server` with ASW-styled error pages and directory listings.
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
# Copy to your project
|
|
cp asw_server.py /path/to/project/
|
|
|
|
# Run it
|
|
python asw_server.py # port 8000
|
|
python asw_server.py 3000 # custom port
|
|
python asw_server.py 3000 /dir # custom port + custom directory
|
|
```
|
|
|
|
## What you get
|
|
|
|
- **ASW-styled error pages** for all HTTP error codes (403, 404, 500, etc.)
|
|
- **ASW-styled directory listings** replacing the browser-default autoindex
|
|
- **Auto port fallback** — if 8000 is busy, tries 8001, 8002… up to 10 attempts
|
|
- **Inline styles** — no external CSS dependency, works even when serving offline
|
|
|
|
## How it works
|
|
|
|
`ASWHandler` subclasses `SimpleHTTPRequestHandler` and overrides:
|
|
- `send_error()` — returns ASW-styled HTML instead of the default ugly page
|
|
- `list_directory()` — returns a clean table layout instead of raw `<pre>`
|
|
|
|
Styles are inlined directly in the response — no link to `asw.css` required.
|
|
The colour scheme matches the full ASW dark theme.
|
|
|
|
## No dependencies
|
|
|
|
Just Python 3 standard library. Nothing to install.
|