Skip to content

README fix syntax highlighting #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ This module provides a easy way to apply cursor-based pagination to your Ecto Qu

## Usage:

1. Add macro to your repo
1. Add macro to your repo

```elixir
defmodule MyRepo do
use Ecto.Repo, otp_app: :my_app
use Ecto.Paging.Repo # This string adds `paginate/2` and `page/3` methods.
end
```
```elixir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove padding here? For me, it looked better when code was inside section, not outside of it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, just saw the code formatting block wasn't taking on the Github readme. I don't have any strong opinions

defmodule MyRepo do
use Ecto.Repo, otp_app: :my_app
use Ecto.Paging.Repo # This string adds `paginate/2` and `page/3` methods.
end
```

2. Paginate!
2. Paginate!

```elixir
query = from p in Ecto.Paging.Schema
```elixir
query = from p in Ecto.Paging.Schema

{res, next_paging} = query
|> Ecto.Paging.TestRepo.page(%Ecto.Paging{limit: 150})
```
{res, next_paging} = query
|> Ecto.Paging.TestRepo.page(%Ecto.Paging{limit: 150})
```

## Limitations:

Expand All @@ -33,18 +33,18 @@ This module provides a easy way to apply cursor-based pagination to your Ecto Qu

## Installation

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

```elixir
def deps do
[{:ecto_paging, "~> 0.8.4"}]
end
```
```elixir
def deps do
[{:ecto_paging, "~> 0.8.4"}]
end
```

2. Ensure `ecto_paging` is started before your application:
2. Ensure `ecto_paging` is started before your application:

```elixir
def application do
[applications: [:ecto_paging]]
end
```
```elixir
def application do
[applications: [:ecto_paging]]
end
```