# `Tayori.Sources.Fragments`
[🔗](https://github.com/hattoriai/tayori/blob/v0.1.0/lib/tayori/sources/fragments.ex#L1)

The changes of a folder of Markdown files, one change in each: written
in the pull request that makes the change, read when it ships. The
pattern of [Changesets](https://github.com/changesets/changesets) and
[towncrier](https://towncrier.readthedocs.io), whose files it reads.

    ---
    title: Exports in two clicks
    kind: added
    audience: public
    highlight: true
    ---

    Zip a whole project, with its files, notes and history, and get a
    link by email.

The frontmatter, between `---` lines, is optional, and flat: `key:
value`, with `true`/`false`, and `[a, b]` lists. Its keys:

  * `title` (else the first heading, or the first sentence, of the
    body), `kind` or `type`, `category`, `audience` (`public` or
    `internal`), `segments`, `highlight`, `version`, `author`, `url`,
    and `date` (`2026-10-20`, else the file's time).

Other keys are kept in the change's `:meta`, and a Changesets file's
package lines (`"my-package": minor`) do no harm. A towncrier name,
`123.feature.md`, gives the kind (`feature`) when the frontmatter does
not. The body is the Markdown after the frontmatter.

Options:

  * `:path` - the folder (see `Tayori.Source.path/1`), required.
  * `:recursive` - the folders inside it too (`false`).
  * `:name` - the source's name (`"fragments"`).

A file's ref is its path in the folder: change a file and the change
stays the one it was.

# `parse`

```elixir
@spec parse(String.t(), String.t()) :: Tayori.Source.change() | nil
```

The change of a fragment's text, named `name` in its folder, or nil for
one with nothing to say.

---

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