Skip to content

Commit

Permalink
Update README (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht authored Oct 5, 2017
1 parent c6ebf3c commit efe768f
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,52 @@ Provides Emacs font-lock, indentation, and some useful functions for the Jsonnet
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again -->
**Table of Contents**

- [jsonnet-mode](#jsonnet-mode)
- [Dependencies](#dependencies)
- [Indentation](#indentation)
- [Features](#features)
- [Indentation](#indentation)
- [Formatting](#formatting)
- [Rendering](#rendering)
- [Navigation](#navigation)
- [Configuration](#configuration)
- [Known Issues](#known-issues)

<!-- markdown-toc end -->

# Dependencies

The `jsonnet-eval` method depends on the `jsonnet` binary, which should be available on your `exec-path`. Install this on OSX with Homebrew by running `brew install jsonnet`.
The `jsonnet-eval` method depends on the `jsonnet` binary, which should be
available on your `exec-path`. Install this on OSX with Homebrew by running
`brew install jsonnet`.

# Indentation
# Features

The indentation rules are a set of rules which I put together based on my experience with Jsonnet. You can see them by looking at the implementation of `jsonnet-calculate-indent`.
## Indentation

The indentation rules are a set of rules which I put together based on my
experience with Jsonnet. You can see them by looking at the implementation of
`jsonnet-calculate-indent`.

## Formatting

Closely related to indentation is formatting. By running
`jsonnet-reformat-buffer` (bound to `C-c C-r`), the `jsonnet fmt` utility will
reformat your buffer and make it pretty.

## Rendering

To get a snapshot of what your Jsonnet file will render to, run `jsonnet-eval`
(bound to `C-c C-e`). This will popup another window and show the result of
running `jsonnet-command` on the current buffer.

## Navigation

`jsonnet-mode` also provides some methods to make navigation easier. In
particular, `jsonnet-jump` (bound to `C-c C-f`) allows you to jump to the
definition of a given identifier.

# Configuration

There are two customizable parameters which you may configure in this mode:

- `jsonnet-command` allows you to indicate which Jsonnet binary should be used to render a JSON document.
- `jsonnet-enable-debug-print` will cause methods in jsonnet-mode to write messages to the status bar if enabled.

# Known Issues

Indentation support is not perfect. Here are a couple known problems with it:
- When the parameter list to a function is multiple lines long, we should indent 2x tab-width.

0 comments on commit efe768f

Please sign in to comment.