Skip to content

Commit bfa3668

Browse files
committed
Misc doc changes
Besides other documentation changes, this commit ensures the generated HTML doc for HexDocs.pm will become the main reference doc for this Elixir library which leverage on latest features of ExDoc.
1 parent 14840a5 commit bfa3668

File tree

6 files changed

+58
-30
lines changed

6 files changed

+58
-30
lines changed

.formatter.exs

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

.gitignore

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# The directory Mix will write compiled artifacts to.
2-
/_build
2+
/_build/
33

44
# If you run "mix test --cover", coverage assets end up here.
5-
/cover
5+
/cover/
66

77
# The directory Mix downloads your dependencies sources to.
8-
/deps
8+
/deps/
99

10-
# Where 3rd-party dependencies like ExDoc output generated docs.
11-
/doc
10+
# Where third-party dependencies like ExDoc output generated docs.
11+
/doc/
1212

1313
# Ignore .fetch files in case you like to edit your project deps locally.
1414
/.fetch
@@ -19,5 +19,11 @@ erl_crash.dump
1919
# Also ignore archive artifacts (built via "mix archive.build").
2020
*.ez
2121

22+
# Ignore package tarball (built via "mix hex.build").
23+
slugify-*.tar
24+
25+
# Temporary files for e.g. tests.
26+
/tmp
27+
2228
# macOS
2329
.DS_Store

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
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+
38
## 1.3.1 (19.06.2020)
49

510
### Fixes

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Slugify
22

3-
![](https://github.com/jayjun/slugify/workflows/CI/badge.svg)
4-
[![Hex.pm](https://img.shields.io/hexpm/v/slugify.svg)](https://hex.pm/packages/slugify)
3+
[![CI](https://github.com/jayjun/slugify/actions/workflows/main.yml/badge.svg)](https://github.com/jayjun/slugify/actions/workflows/main.yml)
4+
[![Module Version](https://img.shields.io/hexpm/v/slugify.svg)](https://hex.pm/packages/slugify)
5+
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/slugify/)
6+
[![Total Download](https://img.shields.io/hexpm/dt/slugify.svg)](https://hex.pm/packages/slugify)
7+
[![License](https://img.shields.io/hexpm/l/slugify.svg)](https://github.com/jayjun/slugify/blob/master/LICENSE)
8+
[![Last Updated](https://img.shields.io/github/last-commit/jayjun/slugify.svg)](https://github.com/jayjun/slugify/commits/master)
59

610
Transform strings from any language into slugs.
711

@@ -84,7 +88,7 @@ pinyin.
8488

8589
## Installation
8690

87-
Add `slugify` to your list of dependencies in `mix.exs`:
91+
Add `:slugify` to your list of dependencies in `mix.exs`:
8892

8993
```elixir
9094
def deps do
@@ -101,16 +105,17 @@ end
101105

102106
## License
103107

104-
Slugify is released under [MIT][4] license.
108+
Copyright (c) 2017 Tan Jay Jun.
109+
110+
Slugify is released under [MIT](./LICENSE.md) license.
105111

106112
## Credits
107113

108-
Inspired by [Unidecode][5], [Transliteration][6] and [Slugger][7]. Data from [dzcpy/transliteration][6].
114+
Inspired by [Unidecode][4], [Transliteration][5] and [Slugger][6]. Data from [dzcpy/transliteration][6].
109115

110116
[1]: https://www.ietf.org/rfc/rfc3986.txt
111-
[2]: https://hexdocs.pm/slugify/Slug.html
117+
[2]: https://hexdocs.pm/slugify
112118
[3]: https://hex.pm/packages/slugify
113-
[4]: https://github.com/jayjun/slugify/blob/master/LICENSE.md
114-
[5]: http://search.cpan.org/~sburke/Text-Unidecode-1.30/lib/Text/Unidecode.pm
115-
[6]: https://github.com/dzcpy/transliteration
116-
[7]: https://github.com/h4cc/slugger
119+
[4]: http://search.cpan.org/~sburke/Text-Unidecode-1.30/lib/Text/Unidecode.pm
120+
[5]: https://github.com/dzcpy/transliteration
121+
[6]: https://github.com/h4cc/slugger

mix.exs

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@ defmodule Slug.Mixfile do
1010
version: @version,
1111
elixir: "~> 1.8",
1212
name: "Slugify",
13-
description: "Transform strings from any language to slugs for URLs, filenames or fun",
1413
deps: deps(),
1514
package: package(),
16-
docs: [
17-
source_ref: @version,
18-
source_url: @repo_url,
19-
main: "Slug",
20-
api_reference: false,
21-
extra_section: []
22-
]
15+
docs: docs(),
16+
preferred_cli_env: [docs: :docs]
2317
]
2418
end
2519

@@ -30,16 +24,31 @@ defmodule Slug.Mixfile do
3024
defp deps do
3125
[
3226
{:jason, "~> 1.0", only: [:dev, :test, :docs]},
33-
{:ex_doc, "~> 0.22", only: :docs}
27+
{:ex_doc, ">= 0.0.0", only: :docs, runtime: false}
3428
]
3529
end
3630

3731
defp package do
3832
[
39-
files: ["lib/slug.ex", "priv", "mix.exs", "README.md"],
33+
description: "Transform strings from any language into slugs.",
34+
files: ["lib/slug.ex", "priv", "mix.exs", "README.md", "CHANGELOG.md", "LICENSE.md"],
4035
maintainers: ["Tan Jay Jun"],
4136
licenses: ["MIT"],
42-
links: %{"GitHub" => @repo_url}
37+
links: %{
38+
"Changelog" => "https://hexdocs.pm/slugify/changelog.html",
39+
"GitHub" => @repo_url
40+
}
41+
]
42+
end
43+
44+
defp docs do
45+
[
46+
extras: ["CHANGELOG.md", {:"LICENSE.md", [title: "License"]}, "README.md"],
47+
source_ref: @version,
48+
source_url: @repo_url,
49+
main: "readme",
50+
formatters: ["html"],
51+
api_reference: false
4352
]
4453
end
4554
end

mix.lock

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
%{
22
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], []},
33
"earmark": {:hex, :earmark, "1.4.5", "62ffd3bd7722fb7a7b1ecd2419ea0b458c356e7168c1f5d65caf09b4fbdd13c8", [:mix], [], "hexpm", "b7d0e6263d83dc27141a523467799a685965bf8b13b6743413f19a7079843f4f"},
4-
"ex_doc": {:hex, :ex_doc, "0.22.1", "9bb6d51508778193a4ea90fa16eac47f8b67934f33f8271d5e1edec2dc0eee4c", [:mix], [{:earmark, "~> 1.4.0", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "d957de1b75cb9f78d3ee17820733dc4460114d8b1e11f7ee4fd6546e69b1db60"},
4+
"earmark_parser": {:hex, :earmark_parser, "1.4.13", "0c98163e7d04a15feb62000e1a891489feb29f3d10cb57d4f845c405852bbef8", [:mix], [], "hexpm", "d602c26af3a0af43d2f2645613f65841657ad6efc9f0e361c3b6c06b578214ba"},
5+
"ex_doc": {:hex, :ex_doc, "0.24.2", "e4c26603830c1a2286dae45f4412a4d1980e1e89dc779fcd0181ed1d5a05c8d9", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "e134e1d9e821b8d9e4244687fb2ace58d479b67b282de5158333b0d57c6fb7da"},
56
"jason": {:hex, :jason, "1.2.1", "12b22825e22f468c02eb3e4b9985f3d0cb8dc40b9bd704730efa11abd2708c44", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "b659b8571deedf60f79c5a608e15414085fa141344e2716fbd6988a084b5f993"},
6-
"makeup": {:hex, :makeup, "1.0.3", "e339e2f766d12e7260e6672dd4047405963c5ec99661abdc432e6ec67d29ef95", [:mix], [{:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "2e9b4996d11832947731f7608fed7ad2f9443011b3b479ae288011265cdd3dad"},
7-
"makeup_elixir": {:hex, :makeup_elixir, "0.14.1", "4f0e96847c63c17841d42c08107405a005a2680eb9c7ccadfd757bd31dabccfb", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f2438b1a80eaec9ede832b5c41cd4f373b38fd7aa33e3b22d9db79e640cbde11"},
8-
"nimble_parsec": {:hex, :nimble_parsec, "0.6.0", "32111b3bf39137144abd7ba1cce0914533b2d16ef35e8abc5ec8be6122944263", [:mix], [], "hexpm", "27eac315a94909d4dc68bc07a4a83e06c8379237c5ea528a9acff4ca1c873c52"},
7+
"makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"},
8+
"makeup_elixir": {:hex, :makeup_elixir, "0.15.1", "b5888c880d17d1cc3e598f05cdb5b5a91b7b17ac4eaf5f297cb697663a1094dd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "db68c173234b07ab2a07f645a5acdc117b9f99d69ebf521821d89690ae6c6ec8"},
9+
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
10+
"nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"},
911
}

0 commit comments

Comments
 (0)