From b3c475c7fb7c909b7ecccb67ada5697dba7da591 Mon Sep 17 00:00:00 2001 From: Yann Hamdaoui Date: Fri, 19 Jan 2024 10:21:16 +0100 Subject: [PATCH] Update guide for 1.3 CLI syntax Plus a minor cosmetic change, displaying the final code block as a diff. --- src/pages/getting-started.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pages/getting-started.js b/src/pages/getting-started.js index 974f6cd1..46bd8603 100644 --- a/src/pages/getting-started.js +++ b/src/pages/getting-started.js @@ -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: johndoe@example.com @@ -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 @@ -141,7 +142,7 @@ const IndexPage = () => {

Run

-

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 +

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 this installation guide. Once Nix is installed, use nix run to start Nickel and append -- args to pass arguments to the Nickel executable (here we launch an REPL session)

@@ -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 name and version in scripts.test, using the string interpolation syntax %{'{expr}'}:

-
{codeExamples.reuse.diff}
+
{codeExamples.reuse.diff}

Now, if we change version to 0.1.2 and export the result, the test script invocation is updated as well: