Ⅰ. 插件描述
Jsonnet - The data templating languageⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'google/jsonnet'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'google/jsonnet'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'google/jsonnet'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/google/jsonnet
Ⅳ. 文档说明
# Jsonnet - The data templating language
For an introduction to Jsonnet and documentation,
visit our website.
Visit our discussion forum.
Packages
Jsonnet is available on Homebrew:
brew install jsonnetThe Python binding is on pypi:
pip install jsonnetYou 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 jsonnetThe 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](https://github.com/Microsoft/vcpkg) 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:
makeTo build Jsonnet with Clang, run:
make CC=clang CXX=clang++To run the output binary, run:
./jsonnetTo run the reformatter, run:
./jsonnetfmtBazel
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:allTo 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:allThis builds the jsonnet and jsonnetfmt targets defined in cmd/BUILD. To launch
the output binaries, run:
bazel-bin/cmd/jsonnet
bazel-bin/cmd/jsonnetfmtCmake
cmake . -Bbuildcmake --build build --target run_testsContributing
See the contributing page on our website.
Developing Jsonnet
Running tests
To run the comprehensive suite:
make testLocally serving the website
You need a doc/js/libjsonnet.js which can either be downloaded from the
production website:
wget https://jsonnet.org/js/libjsonnet.js -O doc/js/libjsonnet.jsOr you can build it yourself, which requires emscripten):
make doc/js/libjsonnet.jsThen, from the root of the repository you can generate and serve the website using
Jekyll:
tools/scripts/serve_docs.shThis should the website on localhost:8200, automatically rebuild when you change any underlying
files, and automatically refresh your browser when that happens.