Skip to content

Commit 737ae2a

Browse files
committed
Minor documentation improvements
1 parent 5bfe343 commit 737ae2a

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ NetBSD builds are tested in CI against the latest stable release. `celq` aims to
180180
npm install celq
181181
```
182182

183-
This adds celq to `package.json` and makes it available for scripts. It's also possible to run single commands with [npx](https://docs.npmjs.com/cli/v8/commands/npx):
183+
This adds celq to `package.json` and makes it available for scripts. It is also possible to run single commands with [npx](https://docs.npmjs.com/cli/v8/commands/npx):
184184

185185
```bash
186186
npx celq -n '"Hello World"'
@@ -276,7 +276,7 @@ All the documentation in the manual has been hand-crafted. That was done to keep
276276

277277
## License
278278

279-
This project is dual-licensed under the MIT License and Apache 2.0 licenses. See [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE) file for details.
279+
This project is dual-licensed under the MIT License and Apache 2.0 licenses. See [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE) files for details.
280280

281281
The `install.sh` published with each GitHub release and its template at the root of the repository (`template_install.sh`) are licensed independently. Those files are under the CC0-1.0 license. They are the original work of Casey Rodarmor from [just](https://github.com/casey/just) and have been adapted for celq.
282282

docs/comparison_with_other_tools.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
* [jo](https://github.com/jpmens/jo) is less verbose than celq for creating JSON output from the CLI
3636
* jo doesn't read from the input by default. celq needs the `-n` flag to ignore the input.
37-
* jo can created nested objects by composing calls e.g. `jo github=$(jo user=get-celq repo=homebrew-tap)`. At the moment, celq's arguments don't support maps yet
37+
* jo can create nested objects by composing calls e.g. `jo github=$(jo user=get-celq repo=homebrew-tap)`. At the moment, celq's arguments don't support maps yet
3838

3939
## gron vs celq
4040

@@ -53,11 +53,11 @@
5353

5454
## jql vs celq
5555

56-
* [jql](https://github.com/yamafaktory/jql) uses its own syntax to query JSON with selectors. celq is closer to how imperative programming languges access JSON fields.
56+
* [jql](https://github.com/yamafaktory/jql) uses its own syntax to query JSON with selectors. celq is closer to how imperative programming languages access JSON fields.
5757
* jql did not support JSON5, YAML, and TOML when celq was originally written.
5858

5959
## DuckDB JSON vs celq
6060

6161
* [DuckDB](https://duckdb.org/docs/stable/data/json/overview) excels at querying JSON with schemas using SQL
62-
* celq and jq excel at querying unstructed JSON
62+
* celq and jq excel at querying unstructured JSON
6363
* DuckDB did not support JSON5, YAML, and TOML when celq was originally written (and that is probably a good thing)

docs/installation_guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ cargo binstall celq
109109
run: echo ${{ steps.exampleID.outputs.result }}
110110
```
111111
112-
The best practice for GitHub Actions is to select both the version for the tool:
112+
The best practice for GitHub Actions is to select both versions:
113113
* The tool version is specified by the optional `version` parameter
114-
* The action version is specified `celq-action@actionVersion`
114+
* The action version is specified by `celq-action@actionVersion`
115115

116116
For example:
117117
```yaml
@@ -190,7 +190,7 @@ NetBSD builds are tested in CI against the latest stable release. `celq` aims to
190190
npm install celq
191191
```
192192

193-
This adds celq to `package.json` and makes it available for scripts. It's also possible to run single commands with [npx](https://docs.npmjs.com/cli/v8/commands/npx):
193+
This adds celq to `package.json` and makes it available for scripts. It is also possible to run single commands with [npx](https://docs.npmjs.com/cli/v8/commands/npx):
194194

195195
```bash
196196
npx celq -n '"Hello World"'
@@ -240,7 +240,7 @@ Alternatively, add this to `mise.toml`:
240240

241241
## Integrity and Authenticity
242242

243-
`celq` publishes a `SHA256SUMS` file for each of its release in the [GitHub Releases page](https://github.com/IvanIsCoding/celq/releases). The checksum can be used to verify integrity of the downloaded files.
243+
`celq` publishes a `SHA256SUMS` file for each of its releases on the [GitHub Releases page](https://github.com/IvanIsCoding/celq/releases). The checksum can be used to verify the integrity of the downloaded files.
244244

245245
The `celq` installer supports the `--verify-checksum` flag to ensure the integrity of the pre-built binaries:
246246

@@ -290,4 +290,4 @@ Special thanks to the maintainers of:
290290
- **[maturin](https://github.com/PyO3/maturin)** for providing the code to help us build for the Python Package Index
291291
- **[vidmerger](https://github.com/tgotwig/vidmerger)** for providing details on how to package for Chocolatey ([including this blog post](https://dev.to/tgotwig/publish-a-simple-executable-from-rust-on-chocolatey-2pbl))
292292

293-
Thanks also go to [quentinmit@](https://github.com/quentinmit) for guidance on packaging for Nix.
293+
Thanks also go to [quentinmit@](https://github.com/quentinmit) for guidance on packaging for Nix.

docs/manual.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Options:
6060
-r, --raw-output If the output is a JSON string, output it raw without quotes
6161
-S, --sort-keys Output the fields of each object with the keys in sorted order
6262
-f, --from-file <FILE> Read CEL expression from a file
63-
-p, --pretty-print Output JSON with identation and line breaks for human readability
63+
-p, --pretty-print Output JSON with indentation and line breaks for human readability
6464
-g, --greppable Output in a greppable format (gron style)
6565
--no-extensions Disable extensions and use only standard CEL functions
6666
-h, --help Print help
@@ -170,7 +170,7 @@ By default, `celq` reads from the standard input. To read from a file, use `<` f
170170
celq "this.chart.result[0].meta.symbol" < yfinance.json
171171
```
172172

173-
It's also possibile to pipe the output from `cat`:
173+
It is also possible to pipe the output from `cat`:
174174

175175
```bash
176176
cat yfinance.json | celq "this.chart.result[0].meta.symbol"
@@ -219,7 +219,7 @@ cat yfinance.json | celq '{"symbol": this.chart.result[0].meta.longName, "price"
219219

220220
The command outputs: `{"price":271.01,"symbol":"Apple Inc."}`
221221

222-
Notice that by default `celq` does not guarantee the key order of the output. If you require so, pass the `--sort-keys` option:
222+
Notice that by default `celq` does not guarantee the key order of the output. If you require it, pass the `--sort-keys` option:
223223

224224
```bash
225225
cat yfinance.json | celq --sort-keys '{"symbol": this.chart.result[0].meta.longName, "price": this.chart.result[0].meta.regularMarketPrice}'
@@ -236,7 +236,7 @@ In the previous example, the CEL expression for the JSON became long. Let's say
236236
}
237237
```
238238

239-
If we pass the `--from-file` argument, we can load the expression and keep the command succint:
239+
If we pass the `--from-file` argument, we can load the expression and keep the command succinct:
240240

241241
```bash
242242
cat yfinance.json | celq --from-file stock.cel
@@ -251,15 +251,15 @@ echo '["apples", "bananas", "blueberry"]' | celq 'this.slice(1, 3)'
251251
# Outputs: ["bananas", "blueberry"]
252252
```
253253

254-
Slicing follows Python conventions: it is 0-indexed and works with negative indices. The `.slice()` calls always requires two arguments. If you need to slice until the end of the list, do `this.slice(pos, size(this.slice))`. Similarly, do `this.slice(0, pos)` to start from the beginning.
254+
Slicing follows Python conventions: it is 0-indexed and works with negative indices. The `.slice()` call always requires two arguments. If you need to slice until the end of the list, do `this.slice(pos, size(this.slice))`. Similarly, do `this.slice(0, pos)` to start from the beginning.
255255

256-
If you want to keep your CEL code portable, pass the `--no-extensions` arguments to disable slicing and all other extensions.
256+
If you want to keep your CEL code portable, pass the `--no-extensions` argument to disable slicing and all other extensions.
257257

258258
### Dealing with NDJSON
259259

260260
`celq` can deal with [Newline-Delimited JSON (NDJSON)](https://web.archive.org/web/20231218162511/https://ndjson.org/). That format is also called [JSON Lines (JSONL)](https://web.archive.org/web/20251130123805/https://jsonlines.org./).
261261

262-
`celq` detects the content of multi-line files. Firstly, it tries to parse the input as a NDJSON where each line is a JSON value. If that fails, we parse the input as a single JSON file.
262+
`celq` detects the content of multi-line files. First, it tries to parse the input as NDJSON where each line is a JSON value. If that fails, it parses the input as a single JSON file.
263263

264264
Take for example the following file, `example.ndjson`:
265265

@@ -293,7 +293,7 @@ For example:
293293
cat example.json | celq --slurp "this"
294294
```
295295

296-
Outputs: `[{"y":2.5,"x":1.5},{"y":4.5,"x":3.5}]`. In short, it concatenated the input in a single list.
296+
Outputs: `[{"y":2.5,"x":1.5},{"y":4.5,"x":3.5}]`. In short, it concatenates the input into a single list.
297297

298298
That can be convenient. Let's say we want to access all values of `x`:
299299

@@ -327,7 +327,7 @@ For example:
327327
cat yfinance.json | celq --root-var=request "request.chart.result[0].meta.longName"
328328
```
329329

330-
Outputs: `"Apple Inc."`. This feature can be handy when reusing CEL snippets accross different environments, as they will not use `this` as a variable. That becomes particularly useful with the `--from-file` feature.
330+
Outputs: `"Apple Inc."`. This feature can be handy when reusing CEL snippets across different environments, as they will not use `this` as a variable. That becomes particularly useful with the `--from-file` feature.
331331

332332
### Boolean output
333333

@@ -357,7 +357,7 @@ fi
357357

358358
Will print: `apple contains the letter a`.
359359

360-
Often, the `--boolean` flag plays nicely with the `--void` flag. The `--void` flag ommits all outputs to stdout, which can be handy to hide unnecessary `true` or `false` outputs for intermediary steps in bash scripts.
360+
Often, the `--boolean` flag plays nicely with the `--void` flag. The `--void` flag omits all output to stdout, which can be handy to hide unnecessary `true` or `false` outputs for intermediary steps in bash scripts.
361361

362362
Note that for NDJSON inputs, `celq` sets the value based on the value of the last JSON in the NDJSON input.
363363

@@ -389,7 +389,7 @@ Notice that passing the `--from-json5` clashes with the `--slurp` flag and with
389389

390390
### TOML Support
391391

392-
`celq` supports [TOML](https://toml.io/en/), another popular configuration format. For example, `celq` can query it's own manifest file:
392+
`celq` supports [TOML](https://toml.io/en/), another popular configuration format. For example, `celq` can query its own manifest file:
393393

394394
```bash
395395
celq --from-toml 'this.package.version' < Cargo.toml
@@ -427,7 +427,7 @@ The output is `true` and the return code is 0. We validated that the number of r
427427

428428
### YAML with multiple documents
429429

430-
Some YAML files contain multiple documents with separated by `---`. For example, in `multi.yaml`:
430+
Some YAML files contain multiple documents separated by `---`. For example, in `multi.yaml`:
431431

432432
```yaml
433433
author: "Example Author"
@@ -448,7 +448,7 @@ celq --from-yaml 'this[1].tags' < multi.yaml
448448

449449
### XML Support
450450

451-
`celq` supports XML via the `--froml-xml` flag. Take `example.xml`:
451+
`celq` supports XML via the `--from-xml` flag. Take `example.xml`:
452452

453453
<details>
454454
<summary>example.xml</summary>
@@ -526,7 +526,7 @@ By default, `celq` outputs valid JSON. This is generally the best option, but it
526526
echo '["apples", "bananas", "blueberries"]' | celq 'this[0]'
527527
```
528528

529-
Will always outputs `"apples"` with quotes. If you want to save it in an envrionment variable, the quotes will be included. To bypass that, the `--raw-output` option is convenient:
529+
Will always output `"apples"` with quotes. If you want to save it in an environment variable, the quotes will be included. To bypass that, the `--raw-output` option is convenient:
530530

531531
```bash
532532
FRUIT=$(echo '["apples", "bananas", "blueberries"]' | celq --raw-output 'this[0]')
@@ -560,7 +560,7 @@ celq --from-toml -g -S < Cargo.toml > cargo_toml.js
560560

561561
Writes the following to `cargo_toml.js`:
562562

563-
```javacript
563+
```javascript
564564
json = {};
565565
json.bin = [];
566566
json.bin[0] = {};
@@ -575,7 +575,7 @@ For NDJSON inputs, `--greppable` outputs only the last line. This happens to pre
575575

576576
### Reverting filtered grep output
577577

578-
`celq` also has a `--from-gron` flag that parsers the output of `gron` and `celq --greppable`. It is equivalent to `gron -u`. That can be useful for converting output filtered by grep back to JSON.
578+
`celq` also has a `--from-gron` flag that parses the output of `gron` and `celq --greppable`. It is equivalent to `gron -u`. That can be useful for converting output filtered by grep back to JSON.
579579

580580
For example:
581581

@@ -618,4 +618,4 @@ Outputs:
618618

619619
## Pronunciation
620620

621-
`celq` is pronounced *“selk”* / *“selq”*. Kind of like the word `silk` but with an `e` instead.
621+
`celq` is pronounced *“selk”* / *“selq”*. Kind of like the word `silk` but with an `e` instead.

0 commit comments

Comments
 (0)