changeset 192:b818a4561a3c hg-web

Added AI genreated README.md. Needed to be read.
author MrJuneJune <me@mrjunejune.com>
date Sat, 24 Jan 2026 21:52:14 -0800
parents a06710325c30
children 9f4429c49733
files benchmark/README.md config/README.md deita/README.md dowa/README.md graphics/README.md gui_ze/README.md hg-web/README.md hg-web/src/README.md hg-web/src/icons/README.md hg-web/src/icons/close.png hg-web/src/icons/file.svg hg-web/src/icons/folder.png hg-web/src/icons/home.png hg-web/src/icons/repo.svg load_test/README.md markdown_converter/README.md npc/README.md postdog/README.md seobeo/README.md sori/README.md third_party/README.md third_party/highlight/languages/shell.js
diffstat 22 files changed, 456 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmark/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,13 @@
+# benchmark
+
+HTTP framework benchmarking tools and tests.
+
+## Contents
+
+- `bun-http-framework-benchmark/` - Forked benchmark suite for comparing HTTP frameworks
+
+## Usage
+
+```bash
+bazel build //benchmark:...
+```
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,11 @@
+# config
+
+Shared Bazel build configurations and platform definitions.
+
+## Usage
+
+Reference in BUILD files:
+
+```starlark
+load("//config:defs.bzl", ...)
+```
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deita/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,33 @@
+# deita
+
+SQLite database wrapper library for C.
+
+## Features
+
+- Connection management
+- Query building and execution
+- Result handling
+
+## Files
+
+| File | Description |
+|------|-------------|
+| `deita.h` | Public API header |
+| `deita_internal.h` | Internal declarations |
+| `d_sqlite.c` | SQLite wrapper implementation |
+| `d_connection.c` | Connection handling |
+| `d_query.c` | Query execution |
+| `deita_test.c` | Unit tests |
+
+## Usage
+
+```c
+#include "deita/deita.h"
+```
+
+## Building
+
+```bash
+bazel build //deita:deita
+bazel test //deita:deita_test
+```
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dowa/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,43 @@
+# dowa
+
+Core utility library for C. Provides memory management, string operations, and math utilities.
+
+## Features
+
+- Arena allocator and memory utilities
+- String builder and manipulation
+- Math helpers
+- stb_ds.h for dynamic arrays and hash maps
+
+## Files
+
+| File | Description |
+|------|-------------|
+| `dowa.h` | Public API header |
+| `d_memory.c` | Memory management (arena allocator) |
+| `d_string.c` | String utilities |
+| `d_math.c` | Math helpers |
+| `stb_ds.h` | STB dynamic structures |
+| `dowa_test.c` | Unit tests |
+
+## Usage
+
+```c
+#include "dowa/dowa.h"
+
+// Arena allocator
+Arena arena = {0};
+char* str = arena_alloc(&arena, 100);
+arena_free(&arena);
+
+// String builder
+StringBuilder sb = {0};
+sb_append(&sb, "hello");
+```
+
+## Building
+
+```bash
+bazel build //dowa:dowa
+bazel test //dowa:dowa_test
+```
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,8 @@
+# graphics
+
+Graphics experiments and WebGL demos.
+
+## Files
+
+- `index.html` - HTML entry point
+- `index.js` - JavaScript graphics code
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui_ze/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,29 @@
+# gui_ze
+
+Bazel rules for building GUI applications and web frontends.
+
+## Files
+
+| File | Description |
+|------|-------------|
+| `gui_ze.bzl` | Starlark rules for web/GUI builds |
+| `time_to_first_byte.sh` | TTFB measurement script |
+
+## Rules
+
+Provides Bazel rules for:
+- Bundling JavaScript/TypeScript with esbuild
+- Building WASM modules with Emscripten
+- Packaging web applications
+
+## Usage
+
+```starlark
+load("//gui_ze:gui_ze.bzl", "web_bundle", "wasm_cc_binary")
+
+web_bundle(
+    name = "app",
+    entry_point = "src/main.tsx",
+    ...
+)
+```
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hg-web/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,34 @@
+# 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hg-web/src/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,30 @@
+# src
+
+Frontend source files for the Mercurial repository browser.
+
+## Files
+
+| File | Description |
+|------|-------------|
+| `repo-browser.tsx` | Main React component for the repository browser UI |
+| `main.tsx` | React entry point, renders RepoBrowser |
+| `index.html` | HTML template |
+| `index.js` | JavaScript entry point |
+| `index.css` | highlight.js theme styles |
+| `base.css` | Base/reset styles |
+| `build.ts` | esbuild configuration for bundling |
+
+## Components (repo-browser.tsx)
+
+- `RepoBrowser` - Main app component with routing and state
+- `FileList` - Renders directory listing
+- `FileRow` - Individual file/folder row with prefetch on hover
+- `FileViewer` - Modal for viewing code files with syntax highlighting
+- `MarkdownViewerModal` - Modal for rendered markdown files
+- `ReadmeViewer` - Inline README.md display
+- `Breadcrumb` - Navigation breadcrumb
+- `GlobalStyles` - CSS-in-JS with dark/light theme support
+
+## Subdirectories
+
+- `icons/` - Static icon assets
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hg-web/src/icons/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,29 @@
+# icons
+
+Static icon assets for the repository browser UI.
+
+## Files
+
+| File | Description | Source |
+|------|-------------|--------|
+| `folder.png` | Directory/folder icon | Flaticon |
+| `file.svg` | Generic file icon | VSCode Material Icon Theme |
+| `home.png` | Home navigation icon | Flaticon |
+| `repo.svg` | Repository icon (git branch style) | Custom |
+| `close.png` | Modal close button icon | Flaticon |
+
+## Usage
+
+Icons are served as static files at `/icons/` and referenced in `repo-browser.tsx`:
+
+```typescript
+const ICONS = {
+  folder: "/icons/folder.png",
+  file: "/icons/file.svg",
+  home: "/icons/home.png",
+  repo: "/icons/repo.svg",
+  close: "/icons/close.png"
+};
+```
+
+Add to Bazel filegroup for serving.
Binary file hg-web/src/icons/close.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hg-web/src/icons/file.svg	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,1 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>
\ No newline at end of file
Binary file hg-web/src/icons/folder.png has changed
Binary file hg-web/src/icons/home.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hg-web/src/icons/repo.svg	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+  <path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/>
+  <path d="M9 18c-4.51 2-5-2-7-2"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/load_test/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,7 @@
+# load_test
+
+Load testing and performance measurement scripts.
+
+## Files
+
+- `main.py` - Python load testing script
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/markdown_converter/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,52 @@
+# markdown_converter
+
+Markdown to HTML converter written in C, with WASM support for browser use.
+
+## Features
+
+- Headings, paragraphs, lists
+- Code blocks with syntax highlighting
+- Links and images
+- Bold, italic, inline code
+- Blockquotes
+
+## Files
+
+| File | Description |
+|------|-------------|
+| `markdown_to_html.h` | Public API header |
+| `markdown_to_html.c` | C implementation |
+| `markdown_to_html.js` | JavaScript wrapper for WASM |
+| `markdown_to_html.css` | Default styles |
+| `tests/` | Test cases |
+
+## Usage (C)
+
+```c
+#include "markdown_converter/markdown_to_html.h"
+
+char* html = markdown_to_html(markdown_string);
+// use html...
+markdown_free(html);
+```
+
+## Usage (WASM/JavaScript)
+
+```javascript
+import createModule from 'markdown_converter/markdown_to_html_wasm/markdown_to_html_bin.js';
+
+const Module = await createModule();
+const toHtml = Module.cwrap('markdown_to_html', 'number', ['string']);
+const free = Module.cwrap('markdown_free', null, ['number']);
+
+const ptr = toHtml(markdownString);
+const html = Module.UTF8ToString(ptr);
+free(ptr);
+```
+
+## Building
+
+```bash
+bazel build //markdown_converter:markdown_to_html
+bazel build //markdown_converter:markdown_to_html_wasm  # WASM version
+```
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/npc/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,13 @@
+# npc
+
+NPC/character system application.
+
+## Files
+
+- `main.c` - Main application code
+
+## Building
+
+```bash
+bazel build //npc:npc
+```
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/postdog/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,30 @@
+# postdog
+
+GUI application built with raylib. HTTP client with a graphical interface (like Postman).
+
+## Features
+
+- HTTP request builder
+- Response viewer
+- Request history
+
+## Files
+
+| File | Description |
+|------|-------------|
+| `main.c` | Main application |
+| `gui_window_file_dialog.h` | File dialog implementation |
+| `Roboto-Regular.ttf` | UI font |
+| `epi_all_colors.png` | Logo |
+| `history/` | Saved request history |
+
+## Building
+
+```bash
+bazel build //postdog:postdog
+bazel run //postdog:postdog
+```
+
+## Dependencies
+
+- raylib (via //third_party/raylib)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/seobeo/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,49 @@
+# seobeo
+
+HTTP client and networking library for C.
+
+## Features
+
+- HTTP/HTTPS client
+- SSL/TLS support
+- Async networking with libuv
+- Snapshot testing utilities
+
+## Files
+
+| File | Description |
+|------|-------------|
+| `seobeo.h` | Public API header |
+| `seobeo_internal.h` | Internal declarations |
+| `s_http_client.c` | HTTP client implementation |
+| `s_network.c` | Network utilities |
+| `s_ssl.c` | SSL/TLS handling |
+| `s_logging.c` | Logging utilities |
+| `snapshot_creator.c/h` | Snapshot testing |
+| `docs/` | Documentation |
+| `examples/` | Usage examples |
+| `tests/` | Unit tests |
+| `os/` | OS-specific code |
+
+## Usage
+
+```c
+#include "seobeo/seobeo.h"
+
+// Make HTTP request
+HttpResponse* resp = http_get("https://example.com");
+// handle response...
+http_response_free(resp);
+```
+
+## Building
+
+```bash
+bazel build //seobeo:seobeo
+bazel test //seobeo:seobeo_test
+```
+
+## Dependencies
+
+- libuv (via //third_party/libuv)
+- OpenSSL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sori/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,13 @@
+# sori
+
+Audio library for C.
+
+## Files
+
+- `main.c` - Audio implementation
+
+## Building
+
+```bash
+bazel build //sori:sori
+```
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/third_party/README.md	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,26 @@
+# third_party
+
+External dependencies and libraries.
+
+## Contents
+
+| Directory | Description |
+|-----------|-------------|
+| `bun/` | Bun JavaScript runtime |
+| `emsdk/` | Emscripten SDK for WASM compilation |
+| `highlight/` | highlight.js for syntax highlighting |
+| `libuv/` | Async I/O library |
+| `luajit/` | LuaJIT interpreter |
+| `raylib/` | Game/GUI library |
+| `sqlite3/` | SQLite database |
+| `wrk/` | HTTP benchmarking tool |
+
+## Usage
+
+Reference in BUILD files:
+
+```starlark
+deps = ["//third_party/sqlite3:sqlite3"]
+deps = ["//third_party/raylib:raylib"]
+deps = ["//third_party/libuv:libuv"]
+```
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/third_party/highlight/languages/shell.js	Sat Jan 24 21:52:14 2026 -0800
@@ -0,0 +1,31 @@
+/*
+Language: Shell Session
+Requires: bash.js
+Author: TSUYUSATO Kitsune <[email protected]>
+Category: common
+Audit: 2020
+*/
+
+/** @type LanguageFn */
+export default function(hljs) {
+  return {
+    name: 'Shell Session',
+    aliases: [
+      'console',
+      'shellsession'
+    ],
+    contains: [
+      {
+        className: 'meta.prompt',
+        // We cannot add \s (spaces) in the regular expression otherwise it will be too broad and produce unexpected result.
+        // For instance, in the following example, it would match "echo /path/to/home >" as a prompt:
+        // echo /path/to/home > t.exe
+        begin: /^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,
+        starts: {
+          end: /[^\\](?=\s*$)/,
+          subLanguage: 'bash'
+        }
+      }
+    ]
+  };
+}