Skip to content

Commit

Permalink
doc: correctly format code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
half-shell committed Mar 22, 2024
1 parent 596a09f commit 5ffe12a
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ json elements from an Elixir binary stream.
## Usage

```elixir
stream_path = ["data",1,"actions"]
{actions_stream,doc_fun} = File.stream!("example.json",[],2048)
stream_path = ["data", 1, "actions"]
{actions_stream, doc_fun} =
"example.json"
|> File.stream!([],2048)
|> JSONStream.stream(stream_path)
```

Expand All @@ -28,15 +30,16 @@ Else, `doc_fun.()-> :stream_not_finished`.

The package can be installed as:

1. Add json_stream to your list of dependencies in `mix.exs`:

def deps do
[{:json_stream, "~> 0.0.1"}]
end

2. Ensure json_stream is started before your application:

def application do
[applications: [:json_stream]]
end

1. Add json_stream to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:json_stream, "~> 0.0.1"}]
end
```

2. Ensure json_stream is started before your application:
```elixir
def application do
[applications: [:json_stream]]
end
```

0 comments on commit 5ffe12a

Please sign in to comment.