Skip to content

Commit 8af1f09

Browse files
ammarioclaude
andcommitted
docs: Add mdBook documentation framework
- Set up mdBook for comprehensive project documentation - Configure GitHub Actions for automatic deployment to GitHub Pages - Create initial documentation structure with user guides, references, and advanced topics - Add installation, quick start, and configuration guides - Document JavaScript rules, shell scripts, and platform-specific features - Include CLI reference and development documentation - Configure Rust theme with dark mode support and GitHub integration The documentation will be available at https://coder.github.io/httpjail/ once deployed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0aadeaf commit 8af1f09

31 files changed

Lines changed: 956 additions & 5 deletions

.github/workflows/docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- docs # Also deploy from docs branch for testing
8+
paths:
9+
- 'docs/**'
10+
- 'book.toml'
11+
- '.github/workflows/docs.yml'
12+
pull_request:
13+
paths:
14+
- 'docs/**'
15+
- 'book.toml'
16+
- '.github/workflows/docs.yml'
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
pages: write
22+
id-token: write
23+
24+
concurrency:
25+
group: "pages"
26+
cancel-in-progress: false
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Setup mdBook
36+
uses: peaceiris/actions-mdbook@v2
37+
with:
38+
mdbook-version: 'latest'
39+
40+
- name: Build documentation
41+
run: mdbook build
42+
43+
- name: Upload artifact
44+
if: github.event_name != 'pull_request'
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: ./book
48+
49+
deploy:
50+
if: github.event_name != 'pull_request'
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
target/
2-
3-
# Local Claude Code instructions (not committed to repo)
4-
CLAUDE.local.md
5-
artifacts/
1+
book

DOCS_README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# httpjail Documentation
2+
3+
This directory contains the mdBook-based documentation for httpjail.
4+
5+
## Setup
6+
7+
mdBook is already installed. If you need to reinstall:
8+
9+
```bash
10+
cargo install mdbook
11+
```
12+
13+
## Development
14+
15+
To work on the documentation locally:
16+
17+
```bash
18+
# Serve with auto-reload (default port 3000)
19+
mdbook serve
20+
21+
# Or specify a custom port
22+
mdbook serve --port 8080
23+
24+
# Build static files
25+
mdbook build
26+
```
27+
28+
The documentation will be available at `http://localhost:3000`.
29+
30+
## Structure
31+
32+
- `docs/` - Source markdown files
33+
- `book/` - Built static HTML (git-ignored)
34+
- `book.toml` - mdBook configuration
35+
- `.github/workflows/docs.yml` - GitHub Actions for automatic deployment
36+
37+
## Adding Content
38+
39+
1. Add your markdown file to the appropriate directory in `docs/`
40+
2. Update `docs/SUMMARY.md` to include your new page
41+
3. Test locally with `mdbook serve`
42+
4. Commit and push - GitHub Actions will deploy automatically
43+
44+
## Deployment
45+
46+
Documentation is automatically deployed to GitHub Pages when changes are pushed to the `main` branch. The workflow:
47+
48+
1. Builds the documentation using mdBook
49+
2. Deploys to GitHub Pages
50+
3. Available at: https://coder.github.io/httpjail/
51+
52+
## Resources
53+
54+
- [mdBook Documentation](https://rust-lang.github.io/mdBook/)
55+
- [mdBook GitHub](https://github.com/rust-lang/mdBook)
56+
- [CommonMark Spec](https://commonmark.org/) (Markdown standard)

book.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[book]
2+
authors = ["Ammar Bandukwala"]
3+
language = "en"
4+
multilingual = false
5+
src = "docs"
6+
title = "httpjail"
7+
description = "HTTP(S) Request Jailing: Control what your processes can request"
8+
9+
[build]
10+
build-dir = "book"
11+
12+
[preprocessor.index]
13+
14+
[preprocessor.links]
15+
16+
[output.html]
17+
default-theme = "rust"
18+
preferred-dark-theme = "navy"
19+
git-repository-url = "https://github.com/coder/httpjail"
20+
git-repository-icon = "fa-github"
21+
edit-url-template = "https://github.com/coder/httpjail/edit/main/{path}"
22+
site-url = "https://coder.github.io/httpjail/"
23+
cname = ""
24+
mathjax-support = false
25+
copy-fonts = true
26+
additional-css = []
27+
additional-js = []
28+
no-section-label = false
29+
fold.enable = true
30+
fold.level = 0
31+
playground.copyable = true
32+
playground.copy-js = true
33+
playground.line-numbers = false
34+
playground.editable = false
35+
36+
[output.html.search]
37+
enable = true
38+
limit-results = 30
39+
teaser-word-count = 30
40+
use-boolean-and = true
41+
boost-title = 2
42+
boost-hierarchy = 1
43+
boost-paragraph = 1
44+
expand = true
45+
heading-split-level = 3
46+
47+
[output.html.redirect]

docs/SUMMARY.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Summary
2+
3+
[Introduction](./introduction.md)
4+
5+
# User Guide
6+
7+
- [Installation](./guide/installation.md)
8+
- [Quick Start](./guide/quick-start.md)
9+
- [Configuration](./guide/configuration.md)
10+
- [JavaScript Rules](./guide/javascript-rules.md)
11+
- [Shell Scripts](./guide/shell-scripts.md)
12+
- [Request Logging](./guide/request-logging.md)
13+
- [Platform Support](./guide/platform-support.md)
14+
- [Linux](./guide/linux.md)
15+
- [macOS](./guide/macos.md)
16+
- [Security](./guide/security.md)
17+
18+
# Reference
19+
20+
- [Command Line Options](./reference/cli.md)
21+
- [Environment Variables](./reference/environment.md)
22+
- [JavaScript API](./reference/javascript-api.md)
23+
- [Exit Codes](./reference/exit-codes.md)
24+
25+
# Advanced
26+
27+
- [Architecture](./advanced/architecture.md)
28+
- [TLS Interception](./advanced/tls-interception.md)
29+
- [Network Namespaces](./advanced/network-namespaces.md)
30+
- [DNS Protection](./advanced/dns-protection.md)
31+
- [Server Mode](./advanced/server-mode.md)
32+
33+
# Development
34+
35+
- [Building from Source](./development/building.md)
36+
- [Testing](./development/testing.md)
37+
- [Contributing](./development/contributing.md)
38+
- [CI/CD](./development/ci-cd.md)
39+
40+
---
41+
42+
[Security Policy](./security-policy.md)
43+
[License](./license.md)

docs/advanced/architecture.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Architecture

docs/advanced/dns-protection.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# DNS Protection
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Network Namespaces

docs/advanced/server-mode.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Server Mode

docs/advanced/tls-interception.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# TLS Interception

0 commit comments

Comments
 (0)