Skip to content

SamWolfs/ob-jsonnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

ob-jsonnet

Introduction

ob-jsonnet enables Org-Babel support for evaluating jsonnet code. The code is run using the jsonnet command. Libraries can be loaded by setting the JSONNET_PATH or by providing the :jpaths option to the code block.

#+begin_src jsonnet :jpaths "path/to/libsonnet"
  {
    message: libsonnet.sayHello("World"),
  }
#+end_src

:

#+results:
: {
:   message: "Hello World"
: }

Language Specific Header Arguments

In addition to the normal header arguments for Babel, below are some headers specific to jsonnet.

:jpaths
Relative or absolute paths to jsonnet libraries. Can be defined as a string for a single path or a list of strings for multiple paths.
:var
ob-jsonnet also supports Babel variables. Variables are passed using the -V command line option.

Examples

Setting jpaths

#+begin_src jsonnet :jpaths '("path/to/libsonnet" "other/libsonnet")
  ...
#+end_src

Passing variables

#+begin_src jsonnet :var target="World"
  {
    message: "Hello %s" % [std.extVar("target")],
  }
#+end_src

:

#+results:
: {
:   message: "Hello World"
: }

About

Org-Mode Jsonnet language support

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published