Skip to content

Commit 2338ab9

Browse files
committed
docs: add support for llms.txt
1 parent af86bf0 commit 2338ab9

19 files changed

Lines changed: 1156 additions & 1240 deletions

site/astro.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ export default defineConfig({
99
vite: {
1010
plugins: [tailwindcss()]
1111
},
12+
markdown: {
13+
shikiConfig: {
14+
theme: 'css-variables'
15+
}
16+
},
1217
redirects: {
1318
'/docs': '/docs/installation'
1419
}

site/src/content/config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineCollection, z } from "astro:content";
2+
3+
const docs = defineCollection({
4+
type: "content",
5+
schema: z.object({
6+
title: z.string(),
7+
description: z.string().optional(),
8+
order: z.number().optional(),
9+
}),
10+
});
11+
12+
export const collections = { docs };
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
title: Assertions
3+
description: Reference for all Hone assertion types
4+
order: 4
5+
---
6+
7+
Hone provides a rich set of assertions for verifying command output, exit codes, timing, and file contents.
8+
9+
## Output Assertions
10+
11+
### stdout
12+
13+
Assert on the standard output of the most recent (or named) command:
14+
15+
```hone
16+
# Contains - check if output includes text
17+
ASSERT stdout contains "success"
18+
ASSERT stdout contains "Hello, World!"
19+
20+
# Equals - exact match
21+
ASSERT stdout == "exact output"
22+
ASSERT stdout != "not this"
23+
24+
# Regex - pattern matching
25+
ASSERT stdout matches /version \d+\.\d+\.\d+/
26+
ASSERT stdout matches /hello world/i # case insensitive
27+
```
28+
29+
### stderr
30+
31+
Assert on the standard error output:
32+
33+
```hone
34+
# Same operators work for stderr
35+
ASSERT stderr contains "warning"
36+
ASSERT stderr == ""
37+
ASSERT stderr matches /error: .*/
38+
```
39+
40+
### Raw Output
41+
42+
By default, ANSI escape codes are stripped from output. Use `.raw` to preserve them:
43+
44+
```hone
45+
# Access raw output with ANSI codes preserved
46+
ASSERT stdout.raw contains "\x1b[32m"
47+
```
48+
49+
## Exit Code Assertions
50+
51+
Verify the exit status of commands:
52+
53+
```hone
54+
# Check exit status
55+
ASSERT exit_code == 0
56+
ASSERT exit_code != 0
57+
ASSERT exit_code == 42
58+
```
59+
60+
## Duration Assertions
61+
62+
Check how long a command took to execute. Supports `ms`, `s`, `m`, and `h` units:
63+
64+
```hone
65+
# Time constraints
66+
ASSERT duration < 500ms
67+
ASSERT duration <= 2s
68+
ASSERT duration < 1m
69+
```
70+
71+
## File Assertions
72+
73+
### Existence
74+
75+
Check if a file exists:
76+
77+
```hone
78+
# Check file existence
79+
ASSERT file "output.txt" exists
80+
ASSERT file "/tmp/cache.json" exists
81+
```
82+
83+
### Content
84+
85+
Assert on file contents using the same operators as stdout:
86+
87+
```hone
88+
# Check file contents
89+
ASSERT file "config.yaml" contains "enabled: true"
90+
ASSERT file "output.json" == '{"status": "ok"}'
91+
ASSERT file "version.txt" matches /v\d+\.\d+/
92+
```
93+
94+
## Named Run Targets
95+
96+
When you have multiple RUN commands, use named runs to assert on specific ones:
97+
98+
```hone
99+
RUN compile: gcc main.c -o main
100+
RUN test: ./main --test
101+
102+
# Reference specific commands
103+
ASSERT compile.exit_code == 0
104+
ASSERT compile.stdout contains "compiled"
105+
ASSERT compile.duration < 30s
106+
107+
ASSERT test.exit_code == 0
108+
ASSERT test.stdout contains "PASSED"
109+
```
110+
111+
## Assertion Operators
112+
113+
| Operator | Description | Example |
114+
|----------|-------------|---------|
115+
| `contains` | Substring match | `stdout contains "ok"` |
116+
| `==` | Exact equality | `exit_code == 0` |
117+
| `!=` | Not equal | `stderr != ""` |
118+
| `matches` | Regex pattern | `stdout matches /v\d+/` |
119+
| `exists` | File exists | `file "x.txt" exists` |
120+
| `<` | Less than | `duration < 5s` |
121+
| `<=` | Less than or equal | `duration <= 10s` |
122+
123+
---
124+
125+
**Next Steps**: Learn about configuration options in the [Configuration](/docs/configuration) guide.
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
title: Configuration
3+
description: Configure Hone through pragmas, CLI, and editor integration
4+
order: 5
5+
---
6+
7+
Hone can be configured through file pragmas, CLI options, and editor integration. This page covers all configuration options.
8+
9+
## File Pragmas
10+
11+
Pragmas at the top of a `.hone` file configure that file's test execution:
12+
13+
```hone
14+
#! shell: /bin/zsh
15+
#! env: NODE_ENV=test
16+
#! env: DEBUG=true
17+
#! timeout: 30s
18+
19+
TEST "my test"
20+
RUN echo $NODE_ENV
21+
ASSERT stdout contains "test"
22+
```
23+
24+
| Pragma | Description | Default |
25+
|--------|-------------|---------|
26+
| `shell:` | Shell executable path | `/bin/sh` |
27+
| `env:` | Environment variable (can repeat) ||
28+
| `timeout:` | Max execution time per command ||
29+
30+
## CLI Options
31+
32+
The `hone` CLI accepts several options:
33+
34+
```bash
35+
# Use a custom shell
36+
hone run --shell /bin/zsh tests/
37+
38+
# Show verbose output (useful for debugging)
39+
hone run --verbose tests/
40+
41+
# Show version
42+
hone --version
43+
44+
# Show help
45+
hone --help
46+
```
47+
48+
## Language Server (LSP)
49+
50+
Hone includes a built-in Language Server that provides IDE features for `.hone` files.
51+
52+
### Features
53+
54+
- **Diagnostics** — Real-time syntax and semantic checking
55+
- **Completion** — Context-aware snippets for keywords and assertions
56+
- **Hover** — Documentation for keywords and assertions
57+
- **Outline** — Document structure view
58+
- **Formatting** — Consistent indentation and spacing
59+
- **Semantic Highlighting** — Rich syntax highlighting
60+
61+
### Starting the Server
62+
63+
```bash
64+
# Start the language server
65+
hone lsp
66+
```
67+
68+
### Editor Setup
69+
70+
Use the `setup` command to automatically configure your editor:
71+
72+
```bash
73+
# Configure VS Code
74+
hone setup vscode
75+
76+
# Configure Neovim
77+
hone setup neovim
78+
79+
# Configure multiple editors
80+
hone setup vscode neovim
81+
82+
# List supported editors
83+
hone setup
84+
```
85+
86+
### Manual VS Code Configuration
87+
88+
Add to your `settings.json`:
89+
90+
```json
91+
{
92+
"hone.languageServer": {
93+
"enabled": true,
94+
"command": "hone",
95+
"args": ["lsp"]
96+
}
97+
}
98+
```
99+
100+
### Manual Neovim Configuration
101+
102+
With `nvim-lspconfig`:
103+
104+
```lua
105+
local lspconfig = require('lspconfig')
106+
local configs = require('lspconfig.configs')
107+
108+
if not configs.hone then
109+
configs.hone = {
110+
default_config = {
111+
cmd = { 'hone', 'lsp' },
112+
filetypes = { 'hone' },
113+
root_dir = lspconfig.util.root_pattern('.git'),
114+
single_file_support = true,
115+
},
116+
}
117+
end
118+
119+
lspconfig.hone.setup{}
120+
```
121+
122+
## Exit Codes
123+
124+
Hone uses the following exit codes:
125+
126+
| Code | Meaning |
127+
|------|---------|
128+
| 0 | All tests passed |
129+
| 1 | One or more tests failed |
130+
131+
## LSP Logs
132+
133+
LSP logs are written to platform-specific locations:
134+
135+
- **Linux**`~/.local/state/hone/lsp.log`
136+
- **macOS**`~/Library/Application Support/hone/lsp.log`
137+
- **Windows**`%LOCALAPPDATA%\hone\lsp.log`
138+
139+
---
140+
141+
**You're all set!** Check out the [Examples](/examples) page to see Hone in action with real-world test files.

0 commit comments

Comments
 (0)