Skip to content

Commit

Permalink
Fix documentation (#1844)
Browse files Browse the repository at this point in the history
  • Loading branch information
cydparser committed Mar 11, 2024
1 parent 283d072 commit 01f640b
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ the `nickel-lang-core` crate documentation).
with `brew install nickel`.
- Without Nix, you can use `cargo run --bin nickel` after [building](#build),
passing arguments with an extra `--` as in
`cargo run --bin nickel -- -f program.ncl`.
`cargo run --bin nickel -- eval program.ncl`.

2. Run your first program:

Expand Down
2 changes: 1 addition & 1 deletion doc/manual/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ existing contracts seamlessly as building blocks for new contracts.
If we export this example to JSON, we get:

```console
$ nickel -f config.ncl export
$ nickel export config.ncl
error: contract broken by the value of `server_port`
┌─ example.ncl:26:7
Expand Down
4 changes: 2 additions & 2 deletions doc/manual/merging.md
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ $ nickel export <<< '(import "hello-service.ncl") & {greeter = "country"}'
Documentation is attached via the `doc` keyword. Merging propagates
documentation. Documentation can be retrieved through `nickel query`, the
`:query` command inside the REPL, or when using the LSP. For example, we can
query `foo` by running `nickel -f config.ncl query foo` on:
query `foo` by running `nickel query --field foo config.ncl` on:

```nickel
# config.ncl
Expand All @@ -740,7 +740,7 @@ query `foo` by running `nickel -f config.ncl query foo` on:
```

```console
$ nickel -f config.ncl query foo
$ nickel query --field foo config.ncl
• documentation: Some documentation

Available fields
Expand Down
6 changes: 3 additions & 3 deletions doc/manual/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ By default, nickel exports data as JSON. But we can change that using
the extra parameter `--format yaml` to export as YAML.

```shell
nickel -f users.ncl export --format yaml
nickel export --format yaml users.ncl
```

gives this result:
Expand Down Expand Up @@ -153,11 +153,11 @@ In this extra step, we will make a mistake on purpose in the file
when Nickel detects that a value doesn't satisfy a contract.

Edit the file `users.ncl` and delete the line `name = "Alice",`. Now
export the file again using `nickel -f users.ncl export --format yaml`.
export the file again using `nickel export --format yaml users.ncl`.
You should see the following error:

```console
$ nickel export -f users.ncl --format yaml
$ nickel export --format yaml users.ncl
error: missing definition for `name`
┌─ users-schemas.ncl:4:5
Expand Down
6 changes: 3 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data!
run them directly:

```console
$ nickel -f fibonacci.ncl
$ nickel eval fibonacci.ncl
55
```

Expand All @@ -24,7 +24,7 @@ data!
serialized as JSON, which might be more readable:

```console
$ nickel -f merge-main.ncl export
$ nickel export merge-main.ncl
{
"firewall": {
...
Expand All @@ -35,7 +35,7 @@ data!
documentation and other metadata:

```console
$ nickel -f record-contract.ncl query kind
$ nickel query --field kind record-contract.ncl
• contract: [|'ReplicationController, 'ReplicaSet, 'Pod|]
• documentation: The kind of the element being configured.
```
Expand Down
2 changes: 1 addition & 1 deletion examples/arrays/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The code is illustrative: in practice, you should use the array stdlib functions
## Run

```console
nickel -f arrays.ncl export
nickel export arrays.ncl
```

## Playground
Expand Down
2 changes: 1 addition & 1 deletion examples/config-gcc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ invocation of the `gcc` compiler.
## Run

```console
nickel -f config-gcc.ncl export
nickel export config-gcc.ncl
```

## Contracts
Expand Down
2 changes: 1 addition & 1 deletion examples/fibonacci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ exponential version of fibonacci: don't call it on a big value!
## Run

```console
nickel -f fibonacci.ncl
nickel eval fibonacci.ncl
```
4 changes: 2 additions & 2 deletions examples/foreach-pattern/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ This example shows how a _foreach pattern_ works in Nickel using
## Run

```console
nickel -f foreach-pattern.ncl export
nickel export foreach-pattern.ncl
```

Second example:

```console
nickel -f foreach-pattern-on-import.ncl export
nickel export foreach-pattern-on-import.ncl
```
2 changes: 1 addition & 1 deletion examples/imports/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ This example shows how Nickel can transparently import common serialization form
## Run

```console
nickel -f imports.ncl export
nickel export imports.ncl
```
2 changes: 1 addition & 1 deletion examples/merge-priorities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ configuration.
## Run

```console
nickel -f main.ncl export
nickel export main.ncl
```
2 changes: 1 addition & 1 deletion examples/merge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ code to run lies in `main.ncl`. The default value `firewall.enabled` defined in
## Run

```console
nickel -f main.ncl export
nickel export main.ncl
```
2 changes: 1 addition & 1 deletion examples/polymorphism/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ polymorphic types for you.
## Run

```console
nickel -f polymorphism.ncl
nickel eval polymorphism.ncl
```

## Playground
Expand Down
2 changes: 1 addition & 1 deletion examples/record-contract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ schemas in a real world scenario.
## Run

```console
nickel -f record-contract.ncl export --format yaml
nickel export --format yaml record-contract.ncl
```

## Playground
Expand Down
4 changes: 2 additions & 2 deletions examples/simple-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ contracts.
## Run

```console
nickel -f simple-contract-bool.ncl
nickel -f simple-contract-div.ncl
nickel eval simple-contract-bool.ncl
nickel eval simple-contract-div.ncl
```

## Playground
Expand Down

0 comments on commit 01f640b

Please sign in to comment.