Skip to content

Commit 8b8aca5

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 aa5a994 commit 8b8aca5

8 files changed

Lines changed: 98 additions & 68 deletions

File tree

.gitignore

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
1-
/_build
2-
/cover
3-
/deps
4-
/doc
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where third-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
514
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
617
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
720
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
commanded_ecto_projections-*.tar
24+
25+
# Temporary files for e.g. tests.
26+
/tmp/
27+
28+
# Misc.
829
.DS_Store
930
.elixir_ls
1031
/priv/plts/*.plt

CHANGELOG.md

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

3-
## v1.2.1
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+
## v1.2.1 - 2020-12-03
49

510
- Allow exceptions to be rescued by Commanded's event handler ([#37](https://github.com/commanded/commanded-ecto-projections/pull/37)).
611

7-
## v1.2.0
12+
## v1.2.0 - 2020-08-18
813

914
- Support runtime projector names ([#32](https://github.com/commanded/commanded-ecto-projections/pull/32)).
1015
- Support `schema_prefix/2` function ([#33](https://github.com/commanded/commanded-ecto-projections/pull/33)).
1116

1217
---
1318

14-
## v1.1.0
19+
## v1.1.0 - 2020-05-25
1520

1621
### Enhancements
1722

@@ -20,7 +25,7 @@
2025

2126
---
2227

23-
## v1.0.0
28+
## v1.0.0 - 2019-11-21
2429

2530
### Enhancements
2631

@@ -30,7 +35,7 @@
3035

3136
---
3237

33-
## v0.8.0
38+
## v0.8.0 - 2019-01-23
3439

3540
### Enhancements
3641

@@ -57,21 +62,21 @@
5762

5863
---
5964

60-
## v0.7.1
65+
## v0.7.1 - 2018-07-24
6166

6267
### Bug fixes
6368

6469
- Ensure errors encountered while building the `Ecto.Multi` data structure within a `project` function are caught and passed to the `error/3` callback.
6570

66-
## v0.7.0
71+
## v0.7.0 - 2018-07-22
6772

6873
### Enhancements
6974

7075
- Support Commanded's event handler `error/3` callback ([#12](https://github.com/commanded/commanded-ecto-projections/pull/12)).
7176

7277
---
7378

74-
## v0.6.0
79+
## v0.6.0 - 2017-09-29
7580

7681
### Enhancements
7782

@@ -80,15 +85,15 @@
8085

8186
---
8287

83-
## v0.5.0
88+
## v0.5.0 - 2017-09-15
8489

8590
### Enhancements
8691

8792
- Allow an Ecto schema prefix to be defined in config or per handler ([#4](https://github.com/commanded/commanded-ecto-projections/pull/4)).
8893

8994
---
9095

91-
## v0.4.0
96+
## v0.4.0 - 2017-08-03
9297

9398
### Enhancements
9499

LICENSE renamed to LICENSE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
The MIT License (MIT)
2+
23
Copyright (c) 2017 Ben Smith (ben@10consulting.com)
34

45
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

README.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
1-
# Commanded Ecto projections
2-
3-
Read model projections for [Commanded](https://github.com/commanded/commanded) CQRS/ES applications using [Ecto](https://github.com/elixir-ecto/ecto) for persistence.
4-
5-
---
6-
7-
[Changelog](CHANGELOG.md)
8-
9-
MIT License
1+
# Commanded Ecto Projections
102

113
[![Build Status](https://travis-ci.com/commanded/commanded-ecto-projections.svg?branch=master)](https://travis-ci.com/commanded/commanded-ecto-projections)
12-
13-
---
4+
[![Module Version](https://img.shields.io/hexpm/v/commanded_ecto_projections.svg)](https://hex.pm/packages/commanded_ecto_projections)
5+
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/commanded_ecto_projections/)
6+
[![Total Download](https://img.shields.io/hexpm/dt/commanded_ecto_projections.svg)](https://hex.pm/packages/commanded_ecto_projections)
7+
[![License](https://img.shields.io/hexpm/l/commanded_ecto_projections.svg)](https://github.com/commanded/commanded-ecto-projections/blob/master/LICENSE)
8+
[![Last Updated](https://img.shields.io/github/last-commit/commanded/commanded-ecto-projections.svg)](https://github.com/commanded/commanded-ecto-projections/commits/master)
149

1510
> This README and the following guides follow the `master` branch which may not be the currently published version.
16-
>
17-
> [Read the documentation for the latest published version of Commanded Ecto projections on Hex](https://hexdocs.pm/commanded_ecto_projections/).
1811
19-
### Overview
12+
Model projections for [Commanded](https://github.com/commanded/commanded) CQRS/ES applications using [Ecto](https://github.com/elixir-ecto/ecto) for persistence.
2013

21-
- [Getting started](guides/Getting%20Started.md)
22-
- [Usage](guides/Usage.md)
23-
- [Creating a read model](guides/Usage.md#creating-a-read-model)
24-
- [Creating a projector](guides/Usage.md#creating-a-projector)
25-
- [Supervision](guides/Usage.md#supervision)
26-
- [Error handling](guides/Usage.md#error-handling)
27-
- [`error/3` callback](guides/Usage.md#error3-callback)
28-
- [Error handling example](guides/Usage.md#error-handling-example)
29-
- [`after_update/3` callback](guides/Usage.md#after_update3-callback)
30-
- [Schema prefix](guides/Usage.md#schema-prefix)
31-
- [Rebuilding a projection](guides/Usage.md#rebuilding-a-projection)
14+
Read the [Changelog](CHANGELOG.md) for recent changes and the [Hex Docs](https://hexdocs.pm/commanded_ecto_projections/) on API usage.
3215

33-
---
16+
### Overview
17+
18+
- [Getting started](guides/getting_started.md)
19+
- [Usage](guides/usage.md)
20+
- [Creating a read model](guides/usage.md#creating-a-read-model)
21+
- [Creating a projector](guides/usage.md#creating-a-projector)
22+
- [Supervision](guides/usage.md#supervision)
23+
- [Error handling](guides/usage.md#error-handling)
24+
- [`error/3` callback](guides/usage.md#error3-callback)
25+
- [Error handling example](guides/usage.md#error-handling-example)
26+
- [`after_update/3` callback](guides/usage.md#after_update3-callback)
27+
- [Schema prefix](guides/usage.md#schema-prefix)
28+
- [Rebuilding a projection](guides/usage.md#rebuilding-a-projection)
3429

3530
### Example projector
3631

@@ -77,3 +72,10 @@ mix test
7772
Please [open an issue](https://github.com/commanded/commanded-ecto-projections/issues) if you encounter a problem, or need assistance. You can also seek help in the [Gitter chat room](https://gitter.im/commanded/Lobby) for Commanded.
7873

7974
For commercial support, and consultancy, please contact [Ben Smith](mailto:ben@10consulting.com).
75+
76+
## Copyright and License
77+
78+
Copyright (c) 2017 Ben Smith
79+
80+
This library is released under the MIT License. See the [LICENSE.md](./LICENSE.md) file
81+
for further details.
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@
22

33
You should already have [Ecto](https://github.com/elixir-ecto/ecto) installed and configured before proceeding. Please follow Ecto's [Getting Started](https://hexdocs.pm/ecto/getting-started.html) guide to get going first.
44

5-
1. Add `commanded_ecto_projections` to your list of dependencies in `mix.exs`:
5+
1. Add `:commanded_ecto_projections` to your list of dependencies in `mix.exs`:
66

77
```elixir
88
def deps do
9-
[{:commanded_ecto_projections, "~> 1.2"}]
9+
[
10+
{:commanded_ecto_projections, "~> 1.2"}
11+
]
1012
end
1113
```
1214

13-
2. Generate an Ecto migration in your app:
15+
2. Generate an Ecto migration in your app:
1416

1517
```console
1618
$ mix ecto.gen.migration create_projection_versions
1719
```
1820

19-
3. Modify the generated migration, in `priv/repo/migrations`, to create the `projection_versions` table:
21+
3. Modify the generated migration, in `priv/repo/migrations`, to create the
22+
`projection_versions` table:
2023

2124
```elixir
2225
defmodule CreateProjectionVersions do
@@ -33,13 +36,13 @@ You should already have [Ecto](https://github.com/elixir-ecto/ecto) installed an
3336
end
3437
```
3538

36-
5. Run the Ecto migration:
39+
5. Run the Ecto migration:
3740

3841
```console
3942
$ mix ecto.migrate
4043
```
4144

42-
6. Define your first read model projector:
45+
6. Define your first read model projector:
4346

4447
```elixir
4548
defmodule MyApp.ExampleProjector do
@@ -50,4 +53,5 @@ You should already have [Ecto](https://github.com/elixir-ecto/ecto) installed an
5053
end
5154
```
5255

53-
Refer to the Usage guide for more detail on how to configure and use a read model projector.
56+
Refer to the [Usage guide](./guides/usage.md) for more detail on how to
57+
configure and use a read model projector.
File renamed without changes.

lib/projections/ecto.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ defmodule Commanded.Projections.Ecto do
125125
`Ecto.Multi` struct that were executed within the database transaction.
126126
127127
You could use this function to notify subscribers that the read model has been
128-
updated, such as by publishling changes via Phoenix PubSub channels.
128+
updated, such as by publishing changes via Phoenix PubSub channels.
129129
130130
## Example
131131

mix.exs

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
defmodule Commanded.Projections.Ecto.Mixfile do
22
use Mix.Project
33

4+
@source_url "https://github.com/commanded/commanded-ecto-projections"
45
@version "1.2.1"
56

67
def project do
@@ -10,13 +11,12 @@ defmodule Commanded.Projections.Ecto.Mixfile do
1011
elixir: "~> 1.6",
1112
elixirc_paths: elixirc_paths(Mix.env()),
1213
aliases: aliases(),
13-
description: description(),
1414
package: package(),
1515
build_embedded: Mix.env() == :prod,
1616
start_permanent: Mix.env() == :prod,
1717
deps: deps(),
18-
dialyzer: dialyzer(),
19-
docs: docs()
18+
docs: docs(),
19+
dialyzer: dialyzer()
2020
]
2121
end
2222

@@ -41,7 +41,7 @@ defmodule Commanded.Projections.Ecto.Mixfile do
4141

4242
# Test & build tooling
4343
{:dialyxir, "~> 1.0.0", only: [:dev, :test], runtime: false},
44-
{:ex_doc, ">= 0.0.0", only: :dev},
44+
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
4545
{:mix_test_watch, "~> 1.0", only: :dev, runtime: false}
4646
]
4747
end
@@ -53,12 +53,6 @@ defmodule Commanded.Projections.Ecto.Mixfile do
5353
]
5454
end
5555

56-
defp description do
57-
"""
58-
Read model projections for Commanded using Ecto.
59-
"""
60-
end
61-
6256
defp dialyzer do
6357
[
6458
plt_add_apps: [:ecto, :ex_unit],
@@ -69,21 +63,22 @@ defmodule Commanded.Projections.Ecto.Mixfile do
6963

7064
defp docs do
7165
[
72-
main: "Commanded.Projections.Ecto",
73-
canonical: "http://hexdocs.pm/commanded_ecto_projections",
74-
source_ref: "v#{@version}",
7566
extra_section: "GUIDES",
7667
extras: [
7768
"CHANGELOG.md",
78-
"guides/Getting Started.md",
79-
"guides/Usage.md"
69+
{:"LICENSE.md", [title: "License"]},
70+
{:"README.md", [title: "Overview"]},
71+
"guides/getting_started.md",
72+
"guides/usage.md"
8073
],
8174
groups_for_extras: [
82-
Introduction: [
83-
"guides/Getting Started.md",
84-
"guides/Usage.md"
85-
]
86-
]
75+
Introduction: Path.wildcard("guides/*.md")
76+
],
77+
main: "readme",
78+
canonical: "http://hexdocs.pm/commanded_ecto_projections",
79+
source_url: @source_url,
80+
source_ref: "v#{@version}",
81+
formatters: ["html"]
8782
]
8883
end
8984

@@ -95,8 +90,10 @@ defmodule Commanded.Projections.Ecto.Mixfile do
9590
".formatter.exs",
9691
"README*",
9792
"LICENSE*",
93+
"CHANGELOG*",
9894
"priv/repo/migrations"
9995
],
96+
description: "Read model projections for Commanded using Ecto.",
10097
maintainers: ["Ben Smith"],
10198
licenses: ["MIT"],
10299
links: %{

0 commit comments

Comments
 (0)