From 347ef3992f31b3bce1531ba70988a95406bfc218 Mon Sep 17 00:00:00 2001 From: TobiasNx <61879957+TobiasNx@users.noreply.github.com> Date: Fri, 2 Jun 2023 12:51:20 +0200 Subject: [PATCH 1/3] Update README.md Example was wrong. --- README.md | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 86746f00..888f06b6 100644 --- a/README.md +++ b/README.md @@ -72,34 +72,26 @@ Visit [http://localhost:8080/](http://localhost:8080/), and paste this into the # Simple fixes -add_field(hello,"world") -remove_field(my.deep.nested.junk) -copy_field(stats,output.$append) +add_field("hello","world") +remove_field("my.deep.nested.junk") +copy_field("stats","output.$append") # Conditionals -if exists(error) - set_field(is_valid, no) - log(error) -elsif exists(warning) - set_field(is_valid, yes) - log(warning) +if exists("error") + set_field("is_valid", "no") + log("error") +elsif exists("warning") + set_field("is_valid", "yes") + log("warning") else - set_field(is_valid, yes) + set_field("is_valid", "yes") end # Loops -do list(path) - add_field(foo,bar) -end - -# Nested expressions - -do marc_each() - if marc_has(f700) - marc_map(f700a,authors.$append) - end +do list(path: "foo", "var":"$i") + add_field("$i","bar") end ``` From c19a1ed8f0b727597a9f365fbfef529ee223b9ef Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Fri, 2 Jun 2023 12:59:33 +0200 Subject: [PATCH 2/3] Clean up whitespace. (#307) --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 888f06b6..d22a1f0c 100644 --- a/README.md +++ b/README.md @@ -72,26 +72,26 @@ Visit [http://localhost:8080/](http://localhost:8080/), and paste this into the # Simple fixes -add_field("hello","world") +add_field("hello", "world") remove_field("my.deep.nested.junk") -copy_field("stats","output.$append") +copy_field("stats", "output.$append") # Conditionals if exists("error") - set_field("is_valid", "no") - log("error") + set_field("is_valid", "no") + log("error") elsif exists("warning") - set_field("is_valid", "yes") - log("warning") + set_field("is_valid", "yes") + log("warning") else - set_field("is_valid", "yes") + set_field("is_valid", "yes") end # Loops -do list(path: "foo", "var":"$i") - add_field("$i","bar") +do list(path: "foo", "var": "$i") + add_field("$i", "bar") end ``` From 3c9e1ab371ab668f887b68471fcbaa9d0d3ffaf2 Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Fri, 2 Jun 2023 13:18:36 +0200 Subject: [PATCH 3/3] Fix `do list` example. (#307) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d22a1f0c..e70b735c 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ end # Loops do list(path: "foo", "var": "$i") - add_field("$i", "bar") + add_field("$i.bar", "baz") end ```