Skip to content

Commit

Permalink
Update guide for 1.3 CLI syntax
Browse files Browse the repository at this point in the history
Plus a minor cosmetic change, displaying the final code block as a diff.
  • Loading branch information
yannham committed Jan 19, 2024
1 parent 90a6e44 commit b3c475c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pages/getting-started.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ nickel>`,
dep3 = "6.7"
}
}`,
export: `nickel -f example.ncl export --format yaml
export: `nickel export example.ncl --format yaml
---
contributors:
- email: [email protected]
Expand Down Expand Up @@ -104,8 +104,9 @@ scripts = {
version = "0.1.1",
scripts = {
test = m%"
test.sh --option --install %{name} --version "%{version}"
"%`,
- test.sh --option --install example --version "0.1.1"
+ test.sh --option --install %{name} --version "%{version}"
"%,`,
result: `# [...]
scripts:
do_stuff: do_stuff.sh subcommand
Expand Down Expand Up @@ -141,7 +142,7 @@ const IndexPage = () => {

<h3>Run</h3>

<p>With a recent version of Nix (> 2.4.0), you can build and run Nickel in one shot. If you haven't installed Nix yet, please follow
<p>With a recent version of Nix ({'>'} 2.4.0), you can build and run Nickel in one shot. If you haven't installed Nix yet, please follow
<a className={"link-primary"} href={"https://nixos.org/guides/nix-pills/install-on-your-running-system.html"}> this installation guide</a>. Once Nix is installed, use <code>nix run</code> to start Nickel
and append <code>-- args</code> to pass arguments to the Nickel executable (here we launch an REPL session)</p>

Expand Down Expand Up @@ -233,7 +234,7 @@ const IndexPage = () => {
ending up with incoherent version numbers in the same configuration. To remedy the problem, let's have a
single source of truth by reusing the value of <code>name</code> and <code>version</code> in <code>scripts.test</code>, using
the string interpolation syntax <code>%{'{expr}'}</code>:</p>
<pre><code className={'language-nickel'}>{codeExamples.reuse.diff}</code></pre>
<pre><code className={'diff'}>{codeExamples.reuse.diff}</code></pre>

<p>Now, if we change version to <code>0.1.2</code> and export the result, the test script
invocation is updated as well:</p>
Expand Down

0 comments on commit b3c475c

Please sign in to comment.