releam/changelog

Types

pub type Changelog {
  Changelog(
    title: String,
    compare_link: Result(String, Nil),
    sections: List(Section),
  )
}

Constructors

  • Changelog(
      title: String,
      compare_link: Result(String, Nil),
      sections: List(Section),
    )
pub type ChangelogConfig {
  ChangelogConfig(previous_tag: String, new_tag: String)
}

Constructors

  • ChangelogConfig(previous_tag: String, new_tag: String)
pub type Section {
  Section(header: CommitType, body: List(Commit))
}

Constructors

  • Section(header: CommitType, body: List(Commit))

Constants

pub const changelog_file_path: String

Functions

pub fn init_changelog_file() -> Result(Nil, FileError)

Creates a CHANGELOG.md file with a title and the insert area comment. Insert area comment is used by releam to inject new releases changelogs after the title and before the previous release changelog

pub fn new(
  package_config: PackageConfig,
  config: ChangelogConfig,
  commits: List(Commit),
) -> Changelog

Generate a Changelog record

pub fn render(
  changelog: Changelog,
  with_title with_title: Bool,
) -> String

Renders a changelog to markdown

pub fn render_commit(commit: Commit) -> String

Renders a commit to markdown as a list item

pub fn write_to_changelog_file(
  changelog: Changelog,
) -> Result(Nil, FileError)

Renders a changelog and inject it to the CHANGELOG.md file. If the file does not exists yet, it will create it.

Search Document