Skip to content

Commit e8fdb6f

Browse files
Refactoring the markdown to pass linting steps
What does this commit/MR/PR do ? - Refactoring the markdown to pass linting steps Why is this commit/MR/PR needed ? - linting helps consistency
1 parent 373d4f0 commit e8fdb6f

File tree

3 files changed

+46
-37
lines changed

3 files changed

+46
-37
lines changed

.remarkrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
["remark-lint-no-file-name-consecutive-dashes"],
2424
["remark-lint-no-file-name-outer-dashes"],
2525
["remark-lint-no-consecutive-blank-lines"],
26-
["remark-lint-maximum-line-length", "100"],
26+
["remark-lint-maximum-line-length", 100],
2727
["remark-lint-no-shell-dollars"],
2828
["remark-lint-heading-style", "atx"],
2929
["remark-lint-heading-increment"],

CHANGELOG.md

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# Changelog
22

3-
## v1.0.1
3+
## v2.0.0
4+
5+
- Relax the requirements for `scrivener_ecto` to allow 1.x and 2.x
6+
versions - thereby also allowing ecto 3.x,
7+
resolves [issue 4](https://github.com/stephenmoloney/scrivener_list/issues/4)
8+
9+
- README example without a Repo module no longer references
10+
a Repo module confusingly - [PR](https://github.com/stephenmoloney/scrivener_list/pull/2)
411

5-
[fixes]
6-
- Cannot pass %Scrivener.Config.t into `Scrivener.Repo.paginate`. Change docs to reflect this.
7-
- Add `:scrivener_ecto` to `applications` and hence quieten warnings for releases.
8-
- bump dependencies & fix warnings for elixir 1.4.
12+
- Formatting introduced with `mix format`
13+
14+
- Linting the README.md file
15+
16+
## v1.0.1
917

18+
- Cannot pass %Scrivener.Config.t into `Scrivener.Repo.paginate`. Change docs to reflect this.
19+
- Add `:scrivener_ecto` to `applications` and hence quieten warnings for releases.
20+
- bump dependencies & fix warnings for elixir 1.4.
1021

1122
## v1.0
1223

13-
- Initial release.
24+
- Initial release.

README.md

+28-30
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,30 @@ allows the pagination of a list of elements.
55

66
## Features
77

8-
1. Scrivener.List extends the protocol `Scrivener.Paginater.paginate/2` from the [scrivener](https://github.com/drewolson/scrivener) library.
9-
2. Scrivener.List also extends the function `MyApp.Repo.paginate/2` from the [scrivener_ecto](https://github.com/drewolson/scrivener_ecto) library.
8+
1. Scrivener.List extends the protocol `Scrivener.Paginater.paginate/2` from the [scrivener](https://github.com/drewolson/scrivener) library.
9+
1. Scrivener.List also extends the function `MyApp.Repo.paginate/2` from the [scrivener_ecto](https://github.com/drewolson/scrivener_ecto) library.
1010

11-
Using the second feature is entirely optional. It is provided as a convenience where the [scrivener_ecto](https://github.com/drewolson/scrivener_ecto)
12-
library is also being used in the project and gives access to the pre-configured `MyApp.Repo` module.
13-
11+
Using the second feature is entirely optional. It's provided as a convenience where the [scrivener_ecto](https://github.com/drewolson/scrivener_ecto)
12+
library is also being used in the project and gives access to the
13+
pre-configured `MyApp.Repo` module.
1414

1515
## Usage
1616

1717
## 1. Usage without a Repo module
1818

19+
```elixir
20+
Scrivener.paginate(list, config)
21+
```
1922

20-
### Function
21-
22-
```Scrivener.paginate(list, config)```
23+
### Arguments (without a repo)
2324

24-
### Arguments
25+
- ```list```: A list of elements to be paginated
2526

26-
- ```list```: A list of elements to be paginated
27-
- ```config```: A configuration object with the pagination details. Can be in any of the following formats:
28-
- ```%{page: page_number, page_size: page_size}``` (map)
29-
- ```[page: page_number, page_size: page_size]``` (Keyword.t)
30-
- ```%Scrivener.Config{page_number: page_number, page_size: page_size}``` (Scrivener.Config.t)
27+
- ```config```: A configuration object with the pagination details.
28+
Can be in any of the following formats:
29+
- ```%{page: page_number, page_size: page_size}``` (map)
30+
- ```[page: page_number, page_size: page_size]``` (Keyword.t)
31+
- ```%Scrivener.Config{page_number: page_number, page_size: page_size}``` (Scrivener.Config.t)
3132

3233
`max_page_size` **cannot** be configured with method 1.
3334

@@ -55,8 +56,7 @@ defp maybe_put_default_config(%{page: page_number, page_size: page_size} = param
5556
defp maybe_put_default_config(_params), do: %Scrivener.Config{page_number: 1, page_size: 10}
5657
```
5758

58-
59-
```elixir
59+
```elixir
6060
list = ["C#", "C++", "Clojure", "Elixir", "Erlang", "Go", "JAVA", "JavaScript", "Lisp",
6161
"PHP", "Perl", "Python", "Ruby", "Rust", "SQL"]
6262

@@ -66,7 +66,6 @@ Scrivener.paginate(list, %{page: 1, page_size: 4}) # map
6666
Scrivener.paginate(list, %{page: 1}) # map with only page number (page_size defaults to 10)
6767
```
6868

69-
7069
## 2. Usage with a Repo module
7170

7271
Usage without a Repo is entirely optional and is added to `Scrivener.List` for convenience.
@@ -81,24 +80,25 @@ defmodule MyApp.Repo do
8180
end
8281
```
8382

84-
### Function
83+
```elixir
84+
MyApp.Repo.paginate(list, config)
85+
```
8586

86-
```MyApp.Repo.paginate(list, config)```
87+
### Arguments (with a repo)
8788

88-
### Arguments
89+
- ```list```: A list of elements to be paginated
8990

90-
- ```list```: A list of elements to be paginated
91-
- ```config```: A configuration object with the pagination details. Can be in any of the following formats:
92-
- ```%{page: page_number, page_size: page_size}``` (map)
93-
- ```[page: page_number, page_size: page_size]``` (Keyword.t)
91+
- ```config```: A configuration object with the pagination details.
92+
Can be in any of the following formats:
93+
- ```%{page: page_number, page_size: page_size}``` (map)
94+
- ```[page: page_number, page_size: page_size]``` (Keyword.t)
9495

9596
`max_page_size` **can** be configured with method 1. See [Scrivener.Ecto](https://github.com/drewolson/scrivener_ecto).
9697

9798
### Example
9899

99100
Example based on [scrivener_ecto](https://github.com/drewolson/scrivener_ecto) readme.
100101

101-
102102
```elixir
103103
def index(conn, params) do
104104
%{age: age, name: name} = params["search"]
@@ -120,7 +120,6 @@ def index(conn, params) do
120120
end
121121
```
122122

123-
124123
## Installation
125124

126125
Add [scrivener_list](https://hex.pm/packages/scrivener_list) to your list of dependencies in `mix.exs`:
@@ -133,18 +132,17 @@ def deps do
133132
end
134133
```
135134

136-
137135
## Tests
138136

139137
```shell
140138
mix test
141139
```
142140

143-
144141
## Acknowledgements
145142

146-
Thanks to [Drew Olson](https://github.com/drewolson) for helping with this, particularly the introduction of the [protocol](http://blog.drewolson.org/extensible-design-with-protocols/).
147-
143+
The introduction of the [protocol](http://blog.drewolson.org/extensible-design-with-protocols/)
144+
for scrivener enabled the separation of this package into it's own
145+
repository.
148146

149147
## Licence
150148

0 commit comments

Comments
 (0)