A web-based C code formatter built around the Betty style standard. Paste your C code, hit the button, get back clean, Betty-compliant output — no CLI required.
- Formats C code to Betty style in one click
- Side-by-side editor — input on the left, formatted output on the right
- Error reporting — surfaces Betty lint errors directly in the UI
- Copy-to-clipboard for both the input and formatted output
- Loading states so you know the formatter is running
holbeditor/
├── backend/
│ ├── app.py # Flask API (format + status endpoints)
│ └── requirements.txt # Python dependencies
└── frontend/
├── index.html # App shell
├── script.js # Vanilla JS — API calls and UI logic
├── style.css # Dark theme with CSS custom properties
└── App.jsx # React alternative implementation
- Python 3.8+
bettyfixerinstalled and available on yourPATH
cd backend
pip install -r requirements.txt
python app.pyThe API will be available at http://localhost:5000.
The frontend is plain HTML — no build step needed. Open frontend/index.html directly in a browser, or serve it with any static file server:
# Python one-liner
python -m http.server 8080 --directory frontendThen visit http://localhost:8080.
Formats a C source file through bettyfixer.
Request body
{
"code": "int main(void)\n{\n return (0);\n}\n"
}Response
{
"original_code": "...",
"formatted_code": "...",
"errors": "..."
}| Field | Type | Description |
|---|---|---|
original_code |
string | The code as submitted |
formatted_code |
string | Betty-formatted output |
errors |
string or null | Stderr from bettyfixer, if any |
Status codes: 200 OK · 400 Bad Request (missing code) · 500 Internal Server Error
Health check.
{ "status": "running" }| Location | Variable | Default | Description |
|---|---|---|---|
frontend/script.js |
API_URL |
http://localhost:5000/format |
Backend endpoint |
backend/app.py |
port |
5000 |
Flask server port |
backend/app.py |
debug |
True |
Flask debug mode |
| Layer | Technology |
|---|---|
| Backend | Python, Flask, bettyfixer |
| Frontend | HTML5, CSS3, Vanilla JS |
| Icons | Lucide |
- The user pastes C code into the input panel and clicks Format in Betty.
- The frontend sends a
POST /formatrequest with the raw code as JSON. - The backend writes the code to a temporary
.cfile, runsbettyfixeron it as a subprocess, reads the modified file back, and returns the result. - The temporary file is deleted in the
finallyblock regardless of success or failure. - The formatted code (and any lint errors) appears in the output panel.
