Skip to content

Commit 014cad4

Browse files
committed
Misc doc changes
Besides other documentation changes, this commit ensures the generated HTML doc for HexDocs.pm will become the source of truth for this Elixir library and leverage on latest features of ExDoc.
1 parent 33f578a commit 014cad4

File tree

6 files changed

+65
-15
lines changed

6 files changed

+65
-15
lines changed

.formatter.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Used by "mix format"
2+
[
3+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
4+
]

.gitignore

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
mix.lock
2-
bench/snapshots/
3-
41
# The directory Mix will write compiled artifacts to.
52
/_build/
63

@@ -10,7 +7,7 @@ bench/snapshots/
107
# The directory Mix downloads your dependencies sources to.
118
/deps/
129

13-
# Where 3rd-party dependencies like ExDoc output generated docs.
10+
# Where third-party dependencies like ExDoc output generated docs.
1411
/doc/
1512

1613
# Ignore .fetch files in case you like to edit your project deps locally.
@@ -21,3 +18,13 @@ erl_crash.dump
2118

2219
# Also ignore archive artifacts (built via "mix archive.build").
2320
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
ecto_ulid-*.tar
24+
25+
# Temporary files, for example, from tests.
26+
/tmp/
27+
28+
# Misc.
29+
mix.lock
30+
bench/snapshots/

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## 0.3.0 (2021-04-20)
9+
### Changed
10+
* ([#5](https://github.com/TheRealReal/ecto-ulid/pull/4))
11+
Support Ecto 3.2.0.
12+
313
## 0.2.0 (2019-01-17)
414
### Breaking Changes
515
* Minimum supported Elixir is now 1.4.

LICENSE renamed to LICENSE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# MIT License
2+
13
Copyright (c) 2018 The RealReal, Inc.
24

35
Permission is hereby granted, free of charge, to any person obtaining

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Ecto.ULID
22

3+
[![Module Version](https://img.shields.io/hexpm/v/ecto_ulid.svg)](https://hex.pm/packages/ecto_ulid)
4+
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ecto_ulid/)
5+
[![Total Download](https://img.shields.io/hexpm/dt/ecto_ulid.svg)](https://hex.pm/packages/ecto_ulid)
6+
[![License](https://img.shields.io/hexpm/l/ecto_ulid.svg)](https://github.com/TheRealReal/ecto-ulid/blob/master/LICENSE.md)
7+
[![Last Updated](https://img.shields.io/github/last-commit/TheRealReal/ecto-ulid.svg)](https://github.com/TheRealReal/ecto-ulid/commits/master)
8+
39
An `Ecto.Type` implementation of [ULID](https://github.com/ulid/spec).
410

511
`Ecto.ULID` should be compatible anywhere that `Ecto.UUID` is supported. It has been confirmed to
@@ -32,6 +38,8 @@ on your system.
3238
The following are results from running the benchmark on an AMD Ryzen Threadripper 1950X:
3339

3440
```
41+
mix bench
42+
...
3543
benchmark name iterations average time
3644
cast/1 10000000 0.25 µs/op
3745
dump/1 10000000 0.50 µs/op
@@ -49,7 +57,7 @@ primary key in a database table, but it can be used for other columns just as ea
4957

5058
### Install
5159

52-
Install `ecto_ulid` from Hex by adding it to the dependencies in `mix.exs`:
60+
Install `:ecto_ulid` from Hex by adding it to the dependencies in `mix.exs`:
5361

5462
```elixir
5563
defp deps do
@@ -119,8 +127,9 @@ Ecto.ULID.bingenerate() #=> <<1, 95, 194, 60, 108, 73, 209, 114, 136, 236, 133,
119127
To backfill old data, it may be helpful to pass a timestamp to `generate/1` or `bingenerate/1`. See
120128
the [API documentation](https://hexdocs.pm/ecto_ulid) for more details.
121129

122-
## License
130+
## Copyright and License
123131

124-
Copyright © 2018 The RealReal, Inc.
132+
Copyright (c) 2018 The RealReal, Inc.
125133

126-
Distributed under the [MIT License](./LICENSE).
134+
This library is released under the MIT License. See the [LICENSE.md](./LICENSE.md) file
135+
for further details.

mix.exs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
defmodule Ecto.ULID.Mixfile do
22
use Mix.Project
33

4+
@source_url "https://github.com/TheRealReal/ecto-ulid"
5+
@version "0.3.0"
6+
47
def project do
58
[
69
app: :ecto_ulid,
710
version: "0.3.0",
811
elixir: "~> 1.4",
912
start_permanent: Mix.env == :prod,
10-
deps: deps(),
1113
name: "Ecto.ULID",
12-
description: "An Ecto.Type implementation of ULID.",
14+
deps: deps(),
1315
package: package(),
14-
source_url: "https://github.com/TheRealReal/ecto-ulid",
15-
homepage_url: "https://github.com/TheRealReal/ecto-ulid",
16-
docs: [main: "Ecto.ULID"],
16+
docs: docs()
1717
]
1818
end
1919

@@ -25,17 +25,35 @@ defmodule Ecto.ULID.Mixfile do
2525

2626
defp package do
2727
[
28+
description: "An Ecto.Type implementation of ULID.",
2829
maintainers: ["David Cuddeback"],
2930
licenses: ["MIT"],
30-
links: %{"GitHub" => "https://github.com/TheRealReal/ecto-ulid"},
31+
links: %{
32+
"Changelog" => "https://hexdocs.pm/ecto_ulid/changelog.html",
33+
"GitHub" => @source_url
34+
},
3135
]
3236
end
3337

3438
defp deps do
3539
[
3640
{:ecto, "~> 2.0 or ~> 3.0"},
3741
{:benchfella, "~> 0.3.5", only: [:dev, :test]},
38-
{:ex_doc, "~> 0.16", only: :dev, runtime: false},
42+
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
43+
]
44+
end
45+
46+
defp docs do
47+
[
48+
extras: [
49+
"CHANGELOG.md": [title: "Changelog"],
50+
"LICENSE.md": [title: "License"],
51+
"README.md": [title: "Overview"]
52+
],
53+
main: "readme",
54+
source_url: @source_url,
55+
source_ref: "v#{@version}",
56+
formatters: ["html"]
3957
]
4058
end
4159
end

0 commit comments

Comments
 (0)