Giter Site home page Giter Site logo

vscode-jsonnet's Introduction

Jsonnet Support for Visual Studio Code

A simple bare-bones extension providing simple syntax highlighting for Jsonnet files (specifically, files with the .jsonnet and .libsonnet suffixes), as well as a Markdown-style preview pane that auto-updates every time you save.

Jsonnet preview

Usage

Syntax highlighting works out of the box. Just open any .jsonnet or .libsonnet file, and it will magically work.

To enable the Jsonnet preview pane, it is necessary to install the Jsonnet command line tool (e.g., through brew install jsonnet). If you don't add the jsonnet executable to the PATH then you will need to customize jsonnet.executablePath in your settings.json, so that the extension knows where to find it.

After this, you can use the keybinding for jsonnet.previewToSide (by default this is shift+ctrl+i, or shift+cmd+i on macOS), and the preview pane will open as in the picture above.

Customization

This extension exposes the following settings, which can be customized in settings.json:

  • jsonnet.executablePath: Tells the extension where to find the jsonnet executable, if it's not on the PATH. (NOTE: This setting is always necessary on Windows.)
  • jsonnet.libPaths: Additional paths to search for libraries when compiling Jsonnet code.
  • jsonnet.outputFormat: Preview output format: yaml or json (default is yaml).
  • jsonnet.extStrs: External strings to pass to jsonnet executable.

This extension exposes the following commands, which can be bound to keys:

  • jsonnet.previewToSide: Compiles the Jsonnet file to JSON, places result in a "preview" window in the pane to the right of the active pane, or in the current pane if active window is pane 3 (since vscode only allows 3 panes). Default: bound to shift+ctrl+i (or shift+cmd+i on macOS).
  • jsonnet.previewToSide: Compiles the Jsonnet file to JSON, places result in a "preview" window in the current active pane. Default: no keybinding.
  • jsonnet.extStrs: An object of variable, value pairs. Allows you to customize the external variables passed to the jsonnet command line. It can be particularly useful to set this in a workspace configuration, so that you can set different variables on a per-project basis.
  • jsonnet.outputFormat: A choice of two string literals: ["json", "yaml"]. This tells the extension what format you'd like the output to be (i.e., allows you to either output JSON or YAML).

vscode-jsonnet's People

Contributors

ant31 avatar bryanl avatar hausdorff avatar jbeda avatar nictuku avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.