Skip to content
Jsonnet - The data templating language
Jsonnet C++ Python C Shell HTML Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmarks Add benchmark for object field caching (#663) Jul 30, 2019
case_studies Micromanage (#737) Dec 10, 2019
cmd Remove incorrect message (#729) Nov 6, 2019
core Allow disabling the build of static libraries Aug 12, 2019
cpp Release 0.14.0 Sep 16, 2019
doc [stdlib] Add std.repeat Dec 20, 2019
editors Remove Vim syntax file since it has been moved to google/vim-jsonnet.… Oct 1, 2015
examples provide a multiline function example Aug 21, 2019
gc_stress Fix fmt tests Feb 24, 2018
include Release 0.14.0 Sep 16, 2019
java_comparison New website Apr 14, 2018
perf_tests Add another realistic benchmark May 8, 2018
python Support for jpathdir in python bindings (#584) Dec 13, 2018
stdlib [stdlib] Add std.repeat Dec 20, 2019
test_cmd Remove incorrect message (#729) Nov 6, 2019
test_suite [stdlib] Add std.repeat Dec 20, 2019
third_party Allow use of the system-installed JSON library Aug 9, 2019
tools don't use --livereload, it's not widely available yet May 15, 2019
vs2017 adding a VS2017 solution and adapting JsonnetJsonValue to be compatib… Aug 22, 2017
.clang-format Reformat code (and add make target to do so) Aug 2, 2017
.gitattributes Add reformatter, fix #73 Mar 1, 2016
.gitignore Also .gitignore the versioned so files (#689) Jul 31, 2019
.travis.yml Add tar of executables to github releases. Aug 28, 2019
CMakeLists.txt Allow disabling the build of static libraries Aug 12, 2019
CMakeLists.txt.in CMake build and test. (#303) Oct 11, 2017
CONTRIBUTING Update push_docs.sh to git clone with SSH. Update docs with new websi… Dec 16, 2015
Dockerfile Include jsonnetfmt build artifact in docker image. #669 Jun 9, 2019
LICENSE Initial commit Aug 6, 2014
MANIFEST.in fix MANIFEST.in Dec 19, 2018
Makefile Makefile: Add DESTDIR Dec 18, 2019
README.md Update README Dec 10, 2019
WORKSPACE Bazel 0.25 update (#641) May 15, 2019
release_checklist.md Add updating documentation to the release checklist Sep 11, 2019
setup.py std.parseJson - a builtin for parsing json (#553) Dec 13, 2018
tests.sh Some UX improvements to commandline tool + cmdline tests Nov 4, 2017

README.md

Jsonnet - The data templating language

Build Status

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

Visit our discussion forum.

Packages

Jsonnet is available on Homebrew:

brew install jsonnet

The Python binding is on pypi:

pip install jsonnet

You can also download and install Jsonnet using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
vcpkg install jsonnet

The Jsonnet port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

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.