Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
Jsonnet - The data templating language
Jsonnet C++ Python C Shell HTML Other
Branch: master
Clone or download
Cannot retrieve the latest commit at this time.
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmarks
case_studies
cmd
core
cpp
doc
editors
examples
gc_stress
include
java_comparison
perf_tests
python
stdlib
test_cmd
test_suite
third_party
tools
vs2017
.clang-format
.gitattributes
.gitignore
.travis.yml
CMakeLists.txt
CMakeLists.txt.in
CONTRIBUTING
Dockerfile
LICENSE
MANIFEST.in
Makefile
README.md
WORKSPACE
setup.py
tests.sh

README.md

Jsonnet - The data templating language

Build Status

For an introduction to Jsonnet and documentation, visit our website.

Visit our discussion forum.

Building Jsonnet

You can use either GCC or Clang to build Jsonnet. Note that on recent versions of macOS, /usr/bin/gcc and /usr/bin/g++ are actually Clang, so there is no difference.

Makefile

To build Jsonnet with GCC, run:

make

To build Jsonnet with Clang, run:

make CC=clang CXX=clang++

To run the output binary, run:

./jsonnet

To run the reformatter, run:

./jsonnetfmt

Bazel

Bazel builds are also supported. Install Bazel if it is not installed already. Then, run the following command to build with GCC:

bazel build -c opt //cmd:all

To build with Clang, use one of these two options:

env CC=clang CXX=clang++ bazel build -c opt //cmd:all

# OR

bazel build -c opt --action_env=CC=clang --action_env=CXX=clang++ //cmd:all

This builds the jsonnet and jsonnetfmt targets defined in cmd/BUILD. To launch the output binaries, run:

bazel-bin/cmd/jsonnet
bazel-bin/cmd/jsonnetfmt

Cmake

cmake . -Bbuild
cmake --build build --target run_tests

Contributing

See the contributing page on our website.

Developing Jsonnet

Running tests

To run the comprehensive suite:

make test

Locally serving the website

First, you need to build the JavaScript version of Jsonnet (which requires emscripten):

make doc/js/libjsonnet.js

Then, from the root of the repository you can generate and serve the website using Jekyll:

tools/scripts/serve_docs.sh

This should the website on localhost:8080, automatically rebuild when you change any underlying files, and automatically refresh your browser when that happens.

You can’t perform that action at this time.