view hg-web/README.md @ 197:0106cb67d958

env var ignore.
author MrJuneJune <me@mrjunejune.com>
date Sat, 14 Feb 2026 16:08:47 -0800
parents b818a4561a3c
children
line wrap: on
line source

# hg-web

A web-based Mercurial repository browser. Provides a GitHub-style interface for browsing files, viewing code with syntax highlighting, and reading markdown documentation.

## Features

- Browse repository files and directories
- View code files with syntax highlighting (highlight.js)
- Render markdown files with WASM-based converter
- Dark/light theme support with system preference detection
- Prefetch on hover for faster navigation

## Structure

```
hg-web/
├── BUILD           # Bazel build configuration
├── deploy.sh       # Deployment script
├── main.c          # C server handling API routes
└── src/            # Frontend source files
```

## Building

```bash
bazel build //hg-web:hg_web
```

## API Endpoints

The C server (`main.c`) provides:

- `GET /api/repo/list?path=` - List directory contents
- `GET /api/repo/file?path=` - Fetch file contents