use jstrdecode, removed unicode-fix.sed & unicode-chk.sh
Use ``jstrdecode(1)` to decode certain JSON strings, such as "Full Name", "Abstract", "Award" and "Organization". We now rely on a correctly decoding `jstrdecode(1)`. The bin tools now rely on `jstrdecode` with the following version or later: > jstrdecode version: 1.0.6 2024-10-08 > JSON parser version: 1.1.7 2024-10-08 Removed `bin/unicode-fix.sed` and `bin/unicode-chk.sh`. Removed `make unicode_chk`. Fixed a few rule dependencies on `Makefile`. Added information about `bin/jval-wrapper.sh` in `bin/README.md`. Changed `bin/csv2entry.sh` VERSION from "1.4 2024-09-27" to "1.5 2024-10-08". Changed `bin/entry2csv.sh` VERSION from "1.4 2024-09-27" to "1.5 2024-10-08". Changed `bin/gen-authors.sh` VERSION from "1.13 2024-09-23" to "1.14 2024-10-08". Changed `bin/gen-location.sh` VERSION from "1.7 2024-09-23" to "1.8 2024-10-08". Changed `bin/gen-years.sh` VERSION from "1.5 2024-09-23" to "1.6 2024-10-08". Changed `bin/jfmt-wrapper.sh` VERSION from "1.2 2024-09-23" to "1.3 2024-10-08". Changed `bin/jprint-wrapper.sh` VERSION from "1.3 2024-09-23" to "1.4 2024-10-08". Changed `bin/jval-wrapper.sh` VERSION from "1.1 2024-09-23" to "1.2 2024-10-08". Changed `bin/output-index-author.sh` VERSION from "1.9 2024-09-23" to "1.10 2024-10-08". Changed `bin/output-year-index.sh` VERSION from "1.5 2024-09-23" to "1.6 2024-10-08". Changed `bin/subst.entry-index.sh` VERSION from "1.7 2024-09-27" to "1.8 2024-10-08". Perform `make www` to perform the above and test under macOS.
This commit is contained in:
1 parent
c1e09c4097
commit
5c060586e6
16 files changed
+382
-1149
No files matched your search
+51
-2
@@ -599,7 +599,7 @@ The [jfmt-wrapper.sh](%%REPO_URL%%/bin/jfmt-wrapper.sh) tool is a wrapper
|
||||
tool for `jfmt(1)`, a tool that will format a JSON
|
||||
# file into a canonical style.
|
||||
|
||||
NOTE: As of 2024 July 28 the `jfmt(1)` tool has not been written,
|
||||
NOTE: As of 2024 Oct 08 the `jfmt(1)` tool has not been written,
|
||||
so [jfmt-wrapper.sh](%%REPO_URL%%/bin/jfmt-wrapper.sh) uses the
|
||||
`JSONPath.sh(1)` tool from the recently forked and modified
|
||||
[JSONPath.sh tool](https://github.com/lcn2/JSONPath.sh).
|
||||
@@ -620,7 +620,7 @@ tool for `jprint(1)`, a tool that will format JSON in a canonical style
|
||||
to stdout.
|
||||
|
||||
NOTE: `jprint(1)` is a planned tool based on `jfmt(1)`.
|
||||
As of 2024 July 28 that tool has not been written, so
|
||||
As of 2024 Oct 08 that tool has not been written, so
|
||||
[jprint-wrapper.sh](%%REPO_URL%%/bin/jprint-wrapper.sh) uses
|
||||
the `JSONPath.sh(1)` tool from the recently forked and modified
|
||||
[JSONPath.sh tool](https://github.com/lcn2/JSONPath.sh).
|
||||
@@ -638,6 +638,55 @@ Or use in a pipe:
|
||||
```
|
||||
|
||||
|
||||
<div id="jval-wrapper">
|
||||
### [jval-wrapper.sh](%%REPO_URL%%/bin/jval-wrapper.sh)
|
||||
</div>
|
||||
|
||||
The [jval-wrapper.sh](%%REPO_URL%%/bin/jval-wrapper.sh) tool is a wrapper
|
||||
tool for `jval(1)`, a tool that will output a JSON value using the
|
||||
XPath for JSON mechanism. For information in XPath for JSON see:
|
||||
|
||||
- [https://goessner.net/articles/JsonPath/](https://goessner.net/articles/JsonPath/)
|
||||
- [https://jsonpath.com](https://jsonpath.com)
|
||||
- [https://github.com/lcn2/JSONPath.sh?tab=readme-ov-file#jsonpath-patterns-and-extensions](https://github.com/lcn2/JSONPath.sh?tab=readme-ov-file#jsonpath-patterns-and-extensions)
|
||||
|
||||
NOTE: As of 2024 Oct 08 the `jval(1)` tool has not been written,
|
||||
so [jval-wrapper.sh](%%REPO_URL%%/bin/jval-wrapper.sh) uses the
|
||||
`jsp(1)` tool from [//github.com/kjozsa/jsp](//github.com/kjozsa/jsp)
|
||||
or if not found, the `JSONPath.sh(1)` tool from the recently forked and modified
|
||||
[JSONPath.sh tool](https://github.com/lcn2/JSONPath.sh).
|
||||
|
||||
Usage:
|
||||
|
||||
``` <!---sh-->
|
||||
bin/jval-wrapper.sh [-b] [-q] [-T] file.json [pattern]
|
||||
|
||||
-b print only values (def: print both JSON member and JSON value)
|
||||
-q remove enclosing double quotes (def: keep any enclosing double quotes)
|
||||
-T trim all newlines (def: do not)
|
||||
|
||||
file.json JSON file to process, - ==> read stdin
|
||||
pattern Xpath for JSON query pattern
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
|
||||
``` <!---sh-->
|
||||
bin/jval-wrapper.sh 1984/mullender/.entry.json '$.award'
|
||||
bin/jval-wrapper.sh 1984/mullender/.entry.json '$..author_handle'
|
||||
|
||||
bin/jval-wrapper.sh 1984/mullender/.entry.json '$.manifest[2]'
|
||||
bin/jval-wrapper.sh -q 1984/mullender/.entry.json '$.manifest[2]'
|
||||
|
||||
bin/jval-wrapper.sh -b 1984/mullender/.entry.json '$.manifest[2].entry_text'
|
||||
bin/jval-wrapper.sh -b -q 1984/mullender/.entry.json '$.manifest[2].inventory_order'
|
||||
|
||||
bin/jval-wrapper.sh author/Anton_Algmyr.json '$.full_name'
|
||||
bin/jval-wrapper.sh -q -T author/Anton_Algmyr.json '$.full_name' | jstrdecode -
|
||||
```
|
||||
|
||||
|
||||
<div id="md2html_cfg">
|
||||
### [md2html.cfg](%%REPO_URL%%/bin/md2html.cfg)
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user