ChangelogSource
type ChangelogSource =
{
Label: string
Path: string
Slug: string option
Group: string option
LabelFrom: (string -> string) option
}| Assembly | Nacara.Plugin.Changelog |
A changelog to publish.
Fields
Group: string option
Group: string optionGroup this changelog belongs to, like "Plugins" or "Themes".
The menu offered by the plugin uses it: changelogs sharing the same group are listed together under a heading with that name. If you don't set it, the changelog is listed on its own.
LabelFrom: (string -> string) option
LabelFrom: (string -> string) optionSet when Path is a pattern: how each match is named.
Given the full path of the file that matched.
Functions and values
create (label: string) (path: string) : ChangelogSource
create (label: string) (path: string) : ChangelogSourceA changelog file to publish as a page.
| Parameter | |
|---|---|
label | What the page is called - the package the changelog belongs to. |
path | Where the file is, relative to the project root. ../CHANGELOG.md reaches above the site's own project. |
defaultLabel (path: string) : string
defaultLabel (path: string) : stringHow a match is named when nothing else says.
The directory holding the file, which is the package in the usual layout. One at the root of a repository is named after the file instead - the directory there is only what whoever cloned it chose.
| Parameter | |
|---|---|
path | The full path of the file. |
group (value: string) (source: ChangelogSource) : ChangelogSource
group (value: string) (source: ChangelogSource) : ChangelogSourcePut this changelog under a heading in the menu.
| Parameter | |
|---|---|
value | Name of the heading, for example "Plugins". Changelogs you give the same name are listed together, in the order you declared them. |
source | The changelog to group. |
labelledBy (value: string -> string) (source: ChangelogSource) : ChangelogSource
labelledBy (value: string -> string) (source: ChangelogSource) : ChangelogSourceHow a matched path is named, when the default does not suit your layout.
Given the full path of the file that matched, so you can take whichever part of it names the thing. Only used by matching.
| Parameter | |
|---|---|
value | Path in, name out. |
source | The changelogs being described. |
matching (pattern: string) : ChangelogSource
matching (pattern: string) : ChangelogSourceEvery changelog matching a pattern, named after the directory holding it.
One line instead of a list you have to keep in step with your solution: ../src/*/CHANGELOG.md finds them all, and adding a package needs no edit here.
Anything set on it applies to every match, so a group is declared once. Use labelledBy when the directory is not the name you want.
| Parameter | |
|---|---|
pattern | Where to look, relative to the project root, with * in it. |
ChangelogSource.matching "../src/Nacara.Plugin.*/CHANGELOG.md"
|> ChangelogSource.group "Plugins"
slug (value: string) (source: ChangelogSource) : ChangelogSource
slug (value: string) (source: ChangelogSource) : ChangelogSourceWhat the page is called in a URL, rather than a slug of its label.
| Parameter | |
|---|---|
value | The segment to publish it under - core rather than nacara-core. |
source | The changelog being described. |