Browse Source

update docs for ast loading/saving

pull/9/head v0.2.0
Brett Langdon 12 years ago
parent
commit
c5d9742872
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      README.md

+ 13
- 1
README.md View File

@ -3,7 +3,7 @@ jsfmt.el
emacs plugin to allow running [jsfmt](https://rdio.github.io/jsfmt) on javascript files.
this is basically a clone of the necessary code from `go-mode` for running `gofmt` but used `jsfmt` instead.
This is basically a clone of the necessary code from `go-mode` for running `gofmt` but used `jsfmt` instead.
## Installing
@ -25,6 +25,18 @@ Add the following to `~/.emacs` to run `jsfmt` before saving file:
(add-hook 'before-save-hook 'jsfmt-before-save)
```
### AST loading/saving
`jsfmt` allows for saving/reading files as AST json files. To support this `jsfmt.el` offers
a way to load `.ast` files as javascript and then save the javascript back to an AST on save.
To do so, add the folloing to your `.emacs` file:
```lisp
(load "~/.emacs.d/jsfmt")
(add-to-list 'auto-mode-alist '(\"\\.ast$\" . (lambda()
(jsfmt-ast-mode)
(js-mode))))"
```
## License
The MIT License (MIT) Copyright (c) 2014 Brett Langdon <brett@blangdon.com> (http://brett.is)


Loading…
Cancel
Save