# `Tayori.Source`
[🔗](https://github.com/hattoriai/tayori/blob/v0.1.0/lib/tayori/source.ex#L1)

Where the changes of the inbox come from: a file of the app, a folder of
files, a service. A source is a module with `c:changes/1`, named in the
`:sources` of the `:inbox` config with its options:

    inbox: [
      sources: [
        {Tayori.Sources.Changelog, path: {:my_app, "priv/CHANGELOG.md"}},
        {Tayori.Sources.Fragments, path: {:my_app, "priv/news"}},
        {MyApp.ReleaseNotes, url: "https://..."}
      ]
    ]

Tayori reads them when the app starts (`:ingest_on_start`) and when
`Tayori.Inbox.ingest/0` is called. A change a source gives again, with
the same `:ref`, is not added twice, so a source gives all it has each
time.

Tayori has two: `Tayori.Sources.Changelog` (a Keep a Changelog file)
and `Tayori.Sources.Fragments` (a folder of Markdown files, as
Changesets and towncrier write them).

# `change`

```elixir
@type change() :: map()
```

A change as a source gives it: the attributes of `Tayori.Change`, with
string or atom keys. `:ref` and `:title` are needed.

# `changes`

```elixir
@callback changes(opts :: keyword()) :: {:ok, [change()]} | {:error, term()}
```

The changes the source has now, all of them.

# `name`
*optional* 

```elixir
@callback name(opts :: keyword()) :: String.t()
```

The name of the source, for `Tayori.Change`'s `:source` (the module's last part, lowercased).

# `path`

```elixir
@spec path(Path.t() | {atom(), Path.t()}) :: Path.t()
```

The path of a source's file or folder: an absolute path; a path
relative to the current directory; or `{otp_app, path}`, relative to
the app's directory (`Application.app_dir/2`), which is where a release
keeps `priv/`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
