Skip to content

Commit 4d76a33

Browse files
authored
The first revision (#6)
1 parent af5ba8f commit 4d76a33

File tree

6 files changed

+92
-26
lines changed

6 files changed

+92
-26
lines changed

.github/workflows/docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish API Documentation
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
deploy-docs:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v4
19+
20+
- name: Install Zig
21+
uses: goto-bus-stop/setup-zig@v2
22+
with:
23+
version: '0.14.1'
24+
25+
- name: Install System Dependencies
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y make
29+
30+
- name: Generate Documentation
31+
run: make docs
32+
33+
- name: Deploy to GitHub Pages
34+
uses: peaceiris/actions-gh-pages@v4
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: ./docs/api
38+
publish_branch: gh-pages
39+
user_name: 'github-actions[bot]'
40+
user_email: 'github-actions[bot]@users.noreply.github.com'
41+
commit_message: "docs: Deploy documentation from ${{ github.sha }}"

.github/workflows/lints.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
name: Run Linter Checks
22

33
on:
4-
workflow_dispatch:
5-
pull_request:
4+
push:
65
branches:
76
- main
87
tags:
98
- 'v*'
109

10+
pull_request:
11+
branches:
12+
- main
13+
14+
workflow_dispatch:
15+
1116
permissions:
1217
contents: read
1318

@@ -19,11 +24,15 @@ jobs:
1924
- name: Checkout Code
2025
uses: actions/checkout@v4
2126

27+
- name: Install Zig
28+
uses: goto-bus-stop/setup-zig@v2
29+
with:
30+
version: '0.14.1'
31+
2232
- name: Install Dependencies
2333
run: |
2434
sudo apt-get update
2535
sudo apt-get install -y make
26-
make install-deps
2736
2837
- name: Run Linters
2938
run: make lint

.github/workflows/tests.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
name: Run Tests
22

33
on:
4-
workflow_dispatch:
5-
pull_request:
4+
push:
65
branches:
76
- main
87
tags:
98
- 'v*'
109

10+
pull_request:
11+
branches:
12+
- main
13+
14+
workflow_dispatch:
15+
1116
permissions:
1217
contents: read
1318

@@ -19,11 +24,15 @@ jobs:
1924
- name: Checkout Repository
2025
uses: actions/checkout@v4
2126

27+
- name: Install Zig
28+
uses: goto-bus-stop/setup-zig@v2
29+
with:
30+
version: '0.14.1'
31+
2232
- name: Install Dependencies
2333
run: |
2434
sudo apt-get update
2535
sudo apt-get install -y make
26-
make install-deps
2736
2837
- name: Run the Tests
2938
run: make test

README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
[![Tests](https://img.shields.io/github/actions/workflow/status/habedi/chilli/tests.yml?label=tests&style=flat&labelColor=282c34&logo=github)](https://github.com/habedi/chilli/actions/workflows/tests.yml)
1010
[![CodeFactor](https://img.shields.io/codefactor/grade/github/habedi/chilli?label=code%20quality&style=flat&labelColor=282c34&logo=codefactor)](https://www.codefactor.io/repository/github/habedi/chilli)
1111
[![Zig Version](https://img.shields.io/badge/Zig-0.14.1-orange?logo=zig&labelColor=282c34)](https://ziglang.org/download/)
12-
[![License](https://img.shields.io/badge/license-MIT-007ec6?label=license&style=flat&labelColor=282c34&logo=open-source-initiative)](https://github.com/habedi/chilli/blob/main/LICENSE)
12+
[![Docs](https://img.shields.io/github/v/tag/habedi/chilli?label=docs&color=blue&style=flat&labelColor=282c34&logo=read-the-docs)](https://habedi.github.io/chilli/)
13+
[![Examples](https://img.shields.io/github/v/tag/habedi/chilli?label=examples&color=green&style=flat&labelColor=282c34&logo=zig)](https://github.com/habedi/chilli/tree/main/examples)
1314
[![Release](https://img.shields.io/github/release/habedi/chilli.svg?label=release&style=flat&labelColor=282c34&logo=github)](https://github.com/habedi/chilli/releases/latest)
15+
[![License](https://img.shields.io/badge/license-MIT-007ec6?label=license&style=flat&labelColor=282c34&logo=open-source-initiative)](https://github.com/habedi/chilli/blob/main/LICENSE)
1416

1517
A microframework for creating command-line applications in Zig
1618

@@ -31,11 +33,6 @@ while being small and fast, and not getting in the way of your application logic
3133
- Uses a shared context to pass application state
3234
- Written in pure Zig with no external dependencies
3335

34-
> [!IMPORTANT]
35-
> Chilli is in early development and is not yet ready for serious use.
36-
> The API is not stable and may change without notice.
37-
> Please use the [issues page](https://github.com/habedi/chilli/issues) to report bugs or request features.
38-
3936
---
4037

4138
### Getting Started
@@ -143,22 +140,20 @@ pub fn main() anyerror!void {
143140

144141
### Documentation
145142

146-
You can use the `make docs` command to generate the API documentation for Chilli.
143+
You can find the full API documentation for the latest release of Chilli [here](https://habedi.github.io/chilli/).
144+
145+
Alternatively, you can use the `make docs` command to generate the API documentation for the current version of Chilli
146+
from the source code.
147147
This will generate HTML documentation in the `docs/api` directory, which you can serve locally with `make serve-docs`
148-
and view in your web browser at `http://localhost:8000/index.html`.
148+
and view in your web browser at [http://localhost:8000](http://localhost:8000).
149+
150+
> [!NOTE]
151+
> To generate the documentation, you need to have Zig (version 0.14.1) and Python 3 installed on your system.
149152
150153
### Examples
151154

152-
| **#** | **File** | **Description** |
153-
|-------|-----------------------------------------------------------|--------------------------------------------------------------------------|
154-
| 1 | [e1_simple_cli.zig](examples/e1_simple_cli.zig) | A simple CLI application that shows basic command and flag parsing |
155-
| 2 | [e2_nested_commands.zig](examples/e2_nested_commands.zig) | A CLI application with nested commands and subcommands |
156-
| 3 | [e3_help_output.zig](examples/e3_help_output.zig) | An example that demonstrates automatic help output and usage information |
157-
| 4 | [e4_custom_sections.zig](examples/e4_custom_sections.zig) | An example that demonstrates grouping subcommands into custom sections |
158-
| 5 | [e5_advanced_cli.zig](examples/e5_advanced_cli.zig) | An example that combines multiple features of Chilli |
159-
| 6 | [e6_file_downloader.zig](examples/e6_file_downloader.zig) | A CLI application that downloads files from the internet |
160-
| 7 | [e7_calculator.zig](examples/e7_calculator.zig) | A simple calculator CLI that supports basic arithmetic operations |
161-
| 8 | [e8_flags_and_args.zig](examples/e8_flags_and_args.zig) | Example shows how to use flags and positional arguments in commands |
155+
Check out the [examples](examples/README.md) directory for examples of how Chilli can be used to build a variety of CLI
156+
applications.
162157

163158
### Feature Roadmap
164159

@@ -195,7 +190,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to make a contribution
195190

196191
### License
197192

198-
Chilli is licensed under the MIT License ([LICENSE](LICENSE)).
193+
Chilli is licensed under the MIT License (see [LICENSE](LICENSE)).
199194

200195
### Acknowledgements
201196

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.{
22
.name = .chilli,
3-
.version = "0.1.0",
3+
.version = "0.1.1",
44
.fingerprint = 0x6c259741ae4f5f73, // Changing this has security and trust implications.
55
.minimum_zig_version = "0.14.1",
66
.paths = .{

examples/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Chilli's Examples
2+
3+
| **#** | **File** | **Description** |
4+
|-------|--------------------------------------------------|-----------------------------------------------------------------------------|
5+
| 1 | [e1_simple_cli.zig](e1_simple_cli.zig) | A simple CLI application that shows basic command and flag parsing |
6+
| 2 | [e2_nested_commands.zig](e2_nested_commands.zig) | A CLI application with nested commands and subcommands |
7+
| 3 | [e3_help_output.zig](e3_help_output.zig) | An example that demonstrates automatic help output and usage information |
8+
| 4 | [e4_custom_sections.zig](e4_custom_sections.zig) | An example that demonstrates grouping subcommands into custom sections |
9+
| 5 | [e5_advanced_cli.zig](e5_advanced_cli.zig) | An example that combines multiple features of Chilli |
10+
| 6 | [e6_file_downloader.zig](e6_file_downloader.zig) | A CLI application that downloads files from the internet |
11+
| 7 | [e7_calculator.zig](e7_calculator.zig) | A simple calculator CLI that supports basic arithmetic operations |
12+
| 8 | [e8_flags_and_args.zig](e8_flags_and_args.zig) | An example that shows how to use flags and positional arguments in commands |

0 commit comments

Comments
 (0)