attempt #2 at better list formatting

This commit is contained in:
alisdair sullivan 2012-05-25 09:19:32 -07:00
parent a78a6e28d8
commit 228910caa9

View file

@ -25,20 +25,19 @@ jsx may be built using either [sinan][sinan] or [rebar][rebar]
## quickstart ##
to build the library and run tests
* to build the library and run tests
```bash
tanga:jsx alisdair$ sinan build
tanga:jsx alisdair$ sinan -r tests eunit
```
or
```bash
tanga:jsx alisdair$ rebar compile
tanga:jsx alisdair$ rebar eunit
```
to convert a utf8 binary containing a json string into an erlang term
* to convert a utf8 binary containing a json string into an erlang term
```erlang
1> jsx:decode(<<"{\"library\": \"jsx\", \"awesome\": true}">>).
@ -47,7 +46,7 @@ to convert a utf8 binary containing a json string into an erlang term
[<<"a">>, <<"list">>, <<"of">>, <<"words">>]
```
to convert an erlang term into a utf8 binary containing a json string
* to convert an erlang term into a utf8 binary containing a json string
```erlang
1> jsx:encode([{<<"library">>,<<"jsx">>},{<<"awesome">>,true}]).
@ -56,7 +55,7 @@ to convert an erlang term into a utf8 binary containing a json string
<<"[\"a\",\"list\",\"of\",\"words\"]">>
```
to check if a binary or a term is valid json
* to check if a binary or a term is valid json
```erlang
1> jsx:is_json(<<"[\"this is json\"]">>).
@ -69,7 +68,7 @@ true
false
```
to minify some json
* to minify some json
```erlang
1> jsx:minify(<<"{
@ -82,7 +81,7 @@ to minify some json
<<"{\"a list\":[1,2,3]}">>
```
to prettify some json
* to prettify some json
```erlang
1> jsx:prettify(<<"{\"a list\":[1,2,3]}">>).