Configure Zeus to Use jq to Pretty a Json File

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Configure Zeus to Use jq to Pretty a Json File

Post by jussij »

Installation
1. Download the Windows version of the jq executable found here: https://stedolan.github.io/jq/download/

2. Copy that executable to this Zeus folder location (change the folder to match the user id):

Code: Select all

C:\Users\<your user id>\AppData\Local\Programs\Zeus (x64)\zGNU\
Using jq to Pretty a Json File
Use the Options, Document Types menu and edit the JScript Document Type.

In the Tools Section add the following tool:

Code: Select all

       Menu Text: jq Pretty: '$fn'
    Program Name: jq-win64.exe
       Arguments: . "$f"
  Work Directory: $fdd

    (o) Executable
    (o) Run hidden
    (o) Display on output

    [x] Capture stdout
    [x] Capture stderr
    [ ] Allow user input
    [x] Save current document before running
    [x] Add to popup menu
Using the New Tool
1. Open the following c:\temp\test.json test file:

Code: Select all

{ "folders": [ { "name": "Project: Some Application", "path": "Application" }, { "name": "Project: Other Lib", "path": "Library" } ] }
2. With that file open in Zeus and as the active use the Tools menu to run the jq Validate tool.

3. This will result in the following output:

Code: Select all

{
  "folders": [
    {
      "name": "Project: Some Application",
      "path": "Application"
    },
    {
      "name": "Project: Other Lib",
      "path": "Library"
    }
  ]
}
Post Reply