Skip to content

Commit 69e1c8a

Browse files
committed
Create website
1 parent 8475ff5 commit 69e1c8a

29 files changed

+1203
-33
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: ci
33
on:
44
push:
55
paths-ignore:
6-
- 'doc/**'
6+
- 'site/**'
77
- 'img/**'
88
- 'readme.md'
99
pull_request:
@@ -16,4 +16,4 @@ jobs:
1616
uses: xoofx/.github/.github/actions/dotnet-releaser-action@main
1717
with:
1818
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
19-
GIST_GITHUB_TOKEN: ${{ secrets.GIST_GITHUB_TOKEN }}
19+
GIST_GITHUB_TOKEN: ${{ secrets.GIST_GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,7 @@ tmp/
370370

371371
# Remove artifacts produced by dotnet-releaser
372372
artifacts-dotnet-releaser/
373+
374+
# Ignore Lunet build output
375+
.lunet/build
376+
site/.lunet/build

AGENTS.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# XenoAtom.Logging — Codex Agent Instructions
1+
# XenoAtom.CommandLine — Codex Agent Instructions
22

33
**XenoAtom.CommandLine** is a lightweight, powerful and NativeAOT friendly command line parser for .NET
44

55
Paths/commands below are relative to this directory.
66

77
## Orientation
88

9-
- Library: `src/XenoAtom.Logging/`
10-
- Tests: `src/XenoAtom.Logging.Tests/` (MSTest)
11-
- Docs to keep in sync with behavior: `readme.md` and the docs under `doc/` (e.g., `doc/**/*.md`)
9+
- Library: `src/XenoAtom.CommandLine/`
10+
- Tests: `src/XenoAtom.CommandLine.Tests/` and `src/XenoAtom.CommandLine.Terminal.Tests/` (MSTest)
11+
- Docs to keep in sync with behavior: `readme.md` and the docs under `site/docs/` (e.g., `site/docs/**/*.md`)
1212

1313
## Build & Test
1414

@@ -19,6 +19,12 @@ dotnet build -c Release
1919
dotnet test -c Release
2020
```
2121

22+
```sh
23+
# from the project root (this folder), when site/docs changes
24+
cd site
25+
lunet build
26+
```
27+
2228
All tests must pass and docs must be updated before submitting.
2329

2430
## Contribution Rules (Do/Don't)

readme.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -205,30 +205,24 @@ var app = new CommandApp("myexe", config: new CommandConfig
205205
This package also provides `command.ToHelpVisual(...)` for embedding help in Terminal.UI apps.
206206
For one-shot rendering, `Terminal.Write(...)` is lazily initialized and does not require an explicit terminal session.
207207

208-
Example of the advanced sample with markup help:
208+
Example of the advanced sample:
209209

210-
![Example advanced markup](./img/advanced-markup.png)
211-
212-
Example of the advanced sample with visual help:
213-
214-
![Example advanced visual](./img/advanced-visual.png)
215-
216-
Example of the advanced sample with an error:
217-
218-
![Example advanced error](./img/advanced-error-visual.png)
210+
![Terminal UI help output](https://raw.githubusercontent.com/XenoAtom/XenoAtom.CommandLine/main/site/img/xenoatom-commandline-show.gif)
219211

220212
## 📃 Documentation
221213

222214
| Guide | Description |
223215
|---|---|
224-
| [Getting Started](doc/getting-started.md) | Installation, first application, running and testing |
225-
| [Options](doc/options.md) | Option prototypes, values, flags, aliases, bundling, key/value pairs, typed parsing |
226-
| [Commands](doc/commands.md) | Commands, sub-commands, actions, and conditional groups |
227-
| [Arguments](doc/arguments.md) | Positional arguments, cardinality, remainder arguments |
228-
| [Validation & Constraints](doc/validation.md) | Value validation, mutually exclusive options, requires constraints |
229-
| [Help & Output](doc/help-output.md) | Help text, `CommandUsage`, custom output rendering, Terminal package |
230-
| [Advanced Topics](doc/advanced.md) | Parse API, shell completions, response files, configuration, environment variables, performance |
231-
| [Migration 2.0](doc/migration-2.0.md) | Breaking changes and upgrade steps |
216+
| [Getting Started](site/docs/getting-started.md) | Installation, first application, running and testing |
217+
| [Options](site/docs/options.md) | Option prototypes, values, flags, aliases, bundling, key/value pairs, typed parsing |
218+
| [Commands](site/docs/commands.md) | Commands, sub-commands, actions, and conditional groups |
219+
| [Arguments](site/docs/arguments.md) | Positional arguments, cardinality, remainder arguments |
220+
| [Validation & Constraints](site/docs/validation.md) | Value validation, mutually exclusive options, requires constraints |
221+
| [Help & Output](site/docs/help-output.md) | Help text, `CommandUsage`, custom output rendering, Terminal package |
222+
| [Advanced Topics](site/docs/advanced.md) | Parse API, shell completions, response files, configuration, environment variables, performance |
223+
| [Migration 2.0](site/docs/migration-2.0.md) | Breaking changes and upgrade steps |
224+
225+
Most users migrating from 1.x should have little or no impact; check [Migration 2.0](site/docs/migration-2.0.md) for a quick impact checklist.
232226

233227
## 🏗️ Build
234228

site/.nojekyll

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

site/AGENTS.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
discard: true # Disable this page for website generation
3+
---
4+
5+
# Website (lunet) Contribution Instructions
6+
7+
This folder contains the static website for XenoAtom.CommandLine, built with **lunet**.
8+
9+
## Structure
10+
11+
- `site/readme.md` -> home page (`/`)
12+
- `site/docs/**` -> documentation section (`/docs/**`)
13+
- `site/docs/menu.yml` -> sidebar menu for docs pages
14+
- `site/menu.yml` -> top navigation (navbar)
15+
- `site/.lunet/**` -> layouts, CSS, JS, and build output
16+
- `site/.lunet/layouts/**` -> Scriban HTML layouts
17+
- `site/.lunet/css/**` / `site/.lunet/js/**` -> site assets
18+
- `site/.lunet/build/**` -> generated output (cache + `www/`)
19+
20+
## Building the website
21+
22+
Install lunet (once):
23+
24+
`dotnet tool install -g lunet`
25+
26+
Build the site (always run this after changing `site/**`):
27+
28+
`lunet build`
29+
30+
Run from the `site` folder.
31+
32+
## Notes for agents
33+
34+
- `readme.md` in a folder becomes the folder's `index.html`. Keep these `readme.md` files compatible with both GitHub and the website.
35+
- Update menus when adding/moving pages:
36+
- `site/menu.yml` (top nav)
37+
- `site/docs/menu.yml` (docs sidebar)
38+
- Specs under `site/docs/specs/**` are internal notes and should stay excluded from website navigation/public output.

site/config.scriban

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Use the Lunet template as the base for this documentation site
2+
extend "XenoAtom/lunet_template@1.0.0"
3+
4+
# -----------------------------------------------------------------------------
5+
# SITE SECTION (project-specific values only)
6+
# -----------------------------------------------------------------------------
7+
8+
site_project_name = "XenoAtom.CommandLine"
9+
site_project_description = "A lightweight, powerful and NativeAOT-friendly command line parser for .NET."
10+
site_project_logo_path = "/img/XenoAtom.CommandLine.svg"
11+
site_project_social_banner_path = "/img/advanced-visual.png"
12+
site_project_banner_background_path = "/img/advanced-markup.png"
13+
site_project_package_id = "XenoAtom.CommandLine"
14+
site_project_github_repo = "XenoAtom.CommandLine"
15+
site_project_basepath = "/commandline"
16+
17+
site_project_init

doc/advanced.md renamed to site/docs/advanced.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: "Advanced Topics"
3+
---
4+
15
# Advanced Topics
26

37
This guide covers advanced features of XenoAtom.CommandLine: the parse API for testing, shell completions, response files, configuration, and performance.
@@ -30,6 +34,7 @@ var result = app.Parse(["--name", "Alice", "--port", "8080"]);
3034

3135
### ParseResult Properties
3236

37+
{.table}
3338
| Property | Type | Description |
3439
|---|---|---|
3540
| `ResolvedCommand` | `Command` | The command that was resolved |
@@ -192,6 +197,7 @@ myexe @args.txt
192197

193198
### Response File Syntax
194199

200+
{.table}
195201
| Feature | Syntax | Example |
196202
|---|---|---|
197203
| Whitespace separation | spaces/tabs | `--name John``--name`, `John` |
@@ -241,6 +247,7 @@ var config = new CommandConfig
241247
var app = new CommandApp("myexe", config: config);
242248
```
243249

250+
{.table}
244251
| Property | Default | Description |
245252
|---|---|---|
246253
| `StrictOptionParsing` | `true` | Fail on unknown `-`/`--` tokens |
@@ -263,6 +270,7 @@ var runConfig = new CommandRunConfig(Width: 120, OptionWidth: 32)
263270
await app.RunAsync(args, runConfig);
264271
```
265272

273+
{.table}
266274
| Property | Default | Description |
267275
|---|---|---|
268276
| `Width` | `80` | Terminal width for formatting |
@@ -306,7 +314,7 @@ var colors = new List<Color>();
306314

307315
var app = new CommandApp("myexe")
308316
{
309-
{ "c|color=", $"Console {{COLOR}} ({EnumWrapper<Color>.Names})",
317+
{ "c|color=", "Console {COLOR} (" + EnumWrapper<Color>.Names + ")",
310318
(EnumWrapper<Color> v) => colors.Add(v) },
311319
(ctx, _) => ValueTask.FromResult(0)
312320
};
@@ -354,7 +362,7 @@ dotnet publish -c Release -r win-x64 /p:PublishAot=true
354362

355363
The following diagram shows the main types and their relationships:
356364

357-
![Class diagram](XenoAtom.CommandLine.png)
365+
![Class diagram](../img/architecture.png)
358366

359367
The design is intentionally simple. The main types are:
360368

@@ -378,3 +386,4 @@ All these types inherit from `CommandNode`, the base class for all command tree
378386
- [Arguments](arguments.md) — positional arguments
379387
- [Validation & Constraints](validation.md) — validate values and constraints
380388
- [Help & Output](help-output.md) — customize help rendering
389+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: "Positional Arguments"
3+
---
4+
15
# Positional Arguments
26

37
In addition to options (prefixed with `-`, `--`, `/`), XenoAtom.CommandLine supports positional arguments — values passed without any option prefix that are consumed in declaration order.
@@ -31,6 +35,7 @@ Input: file.txt
3135

3236
The suffix on the argument prototype controls how many values are expected:
3337

38+
{.table}
3439
| Prototype | Cardinality | Meaning |
3540
|---|---:|---|
3641
| `<input>` | Exactly 1 | Required — an error is raised if missing |
@@ -204,3 +209,4 @@ This is especially useful when argument values start with `-`.
204209
- [Options](options.md) — full option reference
205210
- [Commands](commands.md) — sub-commands and groups
206211
- [Validation & Constraints](validation.md) — validate argument values
212+

doc/commands.md renamed to site/docs/commands.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: "Commands"
3+
---
4+
15
# Commands
26

37
XenoAtom.CommandLine supports commands and sub-commands, allowing you to build rich multi-command CLIs similar to `git`, `docker`, or `dotnet`.
@@ -317,3 +321,4 @@ If the parser is currently expecting a value for an option, the next token is **
317321
- [Arguments](arguments.md) — positional arguments and cardinality
318322
- [Validation & Constraints](validation.md) — validate values and declare option relationships
319323
- [Help & Output](help-output.md) — customize help rendering
324+

0 commit comments

Comments
 (0)