1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00
Nicolas Williams 8ea4a5584e Allow variable refs as object keys {$key:value}
Users are often surprised by the requirement to parenthesize any
non-trivial object key expressions in object constructors.  E.g.,
{"a"+"b":1}.  This commit adds one more kind of key expression besides
literals and idents: variable references.

A common use case for this is jq programs as JSON templates to fill in
with variables computed from inputs or passed in on the command-line.
E.g., {some_key:$value}.  Now users can also use, e.g., {$key:$value}.

This and the restrictions on key and value expressions in object
constructors are now clarified a bit in the documentation.
2018-12-10 21:54:59 -06:00
..
2018-11-02 08:15:18 -04:00
2015-08-15 13:23:19 -07:00
2015-08-15 13:23:19 -07:00
2015-08-15 13:03:33 -07:00

Documentation

The jq website, manpages and some of the tests are generated from this directory. The directory holds a Bonsai website, and the manual is a YAML file in content/3.manual.

To build the documentation (including building the jq manpage), you'll need a working Ruby setup. The easiest way to get one is to install RVM and Ruby 1.9.3 like so:

\curl -L https://get.rvm.io | bash -s stable --ruby=1.9.3

After that finishes installing, you'll need to make sure RVM is on your path by doing source $HOME/.rvm/scripts/rvm, or just opening a new shell. See https://rvm.io for more info on RVM.

Once RVM is installed, you can install all the dependencies for jq's documentation build by running this from the docs directory:

bundle install

When bundle manages to install the dependencies, rerun ./configure in the jq root directory and then the Makefile will be able to generate the jq manpage.