{"id":15994684,"url":"https://github.com/taiki-e/parse-changelog","last_synced_at":"2025-04-04T12:09:20.141Z","repository":{"id":37044102,"uuid":"317040587","full_name":"taiki-e/parse-changelog","owner":"taiki-e","description":"Simple changelog parser, written in Rust.","archived":false,"fork":false,"pushed_at":"2025-03-24T14:01:43.000Z","size":851,"stargazers_count":59,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T11:11:15.478Z","etag":null,"topics":["changelog","cli","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taiki-e.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"taiki-e"}},"created_at":"2020-11-29T20:50:04.000Z","updated_at":"2025-03-24T14:01:47.000Z","dependencies_parsed_at":"2023-12-24T12:21:01.420Z","dependency_job_id":"938929e3-b44a-41fd-b469-93fb7040d447","html_url":"https://github.com/taiki-e/parse-changelog","commit_stats":{"total_commits":315,"total_committers":4,"mean_commits":78.75,"dds":"0.022222222222222254","last_synced_commit":"3a68fe922beabaf26b6591cf84badaf0b2660c0e"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fparse-changelog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fparse-changelog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fparse-changelog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fparse-changelog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taiki-e","download_url":"https://codeload.github.com/taiki-e/parse-changelog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174453,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["changelog","cli","rust"],"created_at":"2024-10-08T07:09:47.452Z","updated_at":"2025-04-04T12:09:20.110Z","avatar_url":"https://github.com/taiki-e.png","language":"Rust","funding_links":["https://github.com/sponsors/taiki-e"],"categories":[],"sub_categories":[],"readme":"# parse-changelog\n\n[![crates.io](https://img.shields.io/crates/v/parse-changelog?style=flat-square\u0026logo=rust)](https://crates.io/crates/parse-changelog)\n[![docs.rs](https://img.shields.io/badge/docs.rs-parse--changelog-blue?style=flat-square\u0026logo=docs.rs)](https://docs.rs/parse-changelog)\n[![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)](#license)\n[![msrv](https://img.shields.io/badge/msrv-1.70-blue?style=flat-square\u0026logo=rust)](https://www.rust-lang.org)\n[![github actions](https://img.shields.io/github/actions/workflow/status/taiki-e/parse-changelog/ci.yml?branch=main\u0026style=flat-square\u0026logo=github)](https://github.com/taiki-e/parse-changelog/actions)\n\nSimple changelog parser, written in Rust.\n\n- [Usage (CLI)](#usage-cli)\n  - [Installation](#installation)\n- [Usage (Library)](#usage-library)\n- [Supported Format](#supported-format)\n- [Related Projects](#related-projects)\n- [License](#license)\n\n## Usage (CLI)\n\n`parse-changelog` command parses changelog and outputs a release note for the\nspecified version.\n\n\u003cdetails\u003e\n\u003csummary\u003eComplete list of options (click to show)\u003c/summary\u003e\n\n\u003c!-- readme-long-help:start --\u003e\n```console\n$ parse-changelog --help\nparse-changelog\n\nParse a changelog and output a release note for the specified version.\n\nUSAGE:\n    parse-changelog [OPTIONS] \u003cPATH\u003e [VERSION]\n\nARGS:\n    \u003cPATH\u003e       Path to the changelog file (use '-' for standard input)\n    [VERSION]    Specify version (by default, select the latest release)\n\nOPTIONS:\n    -t, --title                       Output title instead of a note\n        --title-no-link               Similar to --title, but remove links from title\n        --json                        Output JSON representation of all releases in changelog\n        --version-format \u003cPATTERN\u003e    Specify version format\n        --prefix-format \u003cPATTERN\u003e     Specify prefix format [aliases: prefix]\n    -h, --help                        Print help information\n    -V, --version                     Print version information\n```\n\u003c!-- readme-long-help:end --\u003e\n\n\u003c/details\u003e\n\n\u003c!-- omit in toc --\u003e\n### Example: Get Rust's release notes\n\nGet the release note for version 1.46.0 from [Rust's release notes](https://github.com/rust-lang/rust/blob/master/RELEASES.md):\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/rust-lang/rust/master/RELEASES.md \\\n  | parse-changelog - 1.46.0\n```\n\n[*output of the above command.*](tests/fixtures/rust-1.46.0.md)\n\n\u003c!-- omit in toc --\u003e\n### Example: Get Cargo's changelog\n\nIn [Cargo's changelog](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md),\nthe title starts with \"Cargo \", and the patch version is omitted if zero. This is a\nformat `parse-changelog` don't support by default, so use `--prefix` and\n`--version-format` to specify a custom format. For example:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/rust-lang/cargo/master/CHANGELOG.md \\\n  | parse-changelog --prefix 'Cargo ' --version-format '^[0-9]+\\.[0-9]+(\\.[0-9])?$' - 1.50\n```\n\n[*output of the above command.*](tests/fixtures/cargo-1.50.md)\n\n`--prefix` is the same as [`Parser::prefix_format`] and `--version-format` is\nthe same as [`Parser::version_format`]. See documentation of those methods for\nmore information.\n\n\u003c!-- omit in toc --\u003e\n### Example: Create a new GitHub release from changelog\n\nWith [GitHub CLI](https://cli.github.com/manual/gh_release_create):\n\n```sh\ntag=...\nversion=...\n\n# Get notes for $version from CHANGELOG.md.\nnotes=$(parse-changelog CHANGELOG.md \"$version\")\n# Create a new GitHub release with GitHub CLI.\ngh release create \"$tag\" --title \"$version\" --notes \"$notes\"\n```\n\nSee also [create-gh-release-action].\n\n### Installation\n\n\u003c!-- omit in toc --\u003e\n#### From source\n\n```sh\ncargo +stable install parse-changelog --locked\n```\n\n\u003c!-- omit in toc --\u003e\n#### From prebuilt binaries\n\nYou can download prebuilt binaries from the [Release page](https://github.com/taiki-e/parse-changelog/releases).\nPrebuilt binaries are available for macOS, Linux (gnu and musl), Windows (static executable), FreeBSD, and illumos.\n\n\u003cdetails\u003e\n\u003csummary\u003eExample of script to install from the Release page (click to show)\u003c/summary\u003e\n\n```sh\n# Get host target\nhost=$(rustc -vV | grep '^host:' | cut -d' ' -f2)\n# Download binary and install to $HOME/.cargo/bin\ncurl --proto '=https' --tlsv1.2 -fsSL \"https://github.com/taiki-e/parse-changelog/releases/latest/download/parse-changelog-$host.tar.gz\" \\\n  | tar xzf - -C \"$HOME/.cargo/bin\"\n```\n\n\u003c/details\u003e\n\n\u003c!-- omit in toc --\u003e\n#### Via Homebrew\n\nYou can install parse-changelog from the [Homebrew tap maintained by us](https://github.com/taiki-e/homebrew-tap/blob/HEAD/Formula/parse-changelog.rb) (x86_64/AArch64 macOS, x86_64/AArch64 Linux):\n\n```sh\nbrew install taiki-e/tap/parse-changelog\n```\n\n\u003c!-- omit in toc --\u003e\n#### Via Scoop (Windows)\n\nYou can install parse-changelog from the [Scoop bucket maintained by us](https://github.com/taiki-e/scoop-bucket/blob/HEAD/bucket/parse-changelog.json):\n\n```sh\nscoop bucket add taiki-e https://github.com/taiki-e/scoop-bucket\nscoop install parse-changelog\n```\n\n\u003c!-- omit in toc --\u003e\n#### Via cargo-binstall\n\nYou can install parse-changelog using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall):\n\n```sh\ncargo binstall parse-changelog\n```\n\n\u003c!-- omit in toc --\u003e\n#### On GitHub Actions\n\nYou can use [taiki-e/install-action](https://github.com/taiki-e/install-action) to install prebuilt binaries on Linux, macOS, and Windows.\nThis makes the installation faster and may avoid the impact of [problems caused by upstream changes](https://github.com/tokio-rs/bytes/issues/506).\n\n```yaml\n- uses: taiki-e/install-action@parse-changelog\n```\n\n\u003c!-- omit in toc --\u003e\n#### Via other package managers\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/parse-changelog.svg?columns=4)](https://repology.org/project/parse-changelog/versions)\n\n## Usage (Library)\n\n\u003c!-- tidy:sync-markdown-to-rustdoc:start:src/lib.rs --\u003e\n\nTo use this crate as a library, add this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nparse-changelog = { version = \"0.6\", default-features = false }\n```\n\n\u003e [!NOTE]\n\u003e We recommend disabling default features because they enable CLI-related\n\u003e dependencies which the library part does not use.\n\n\u003c!-- omit in toc --\u003e\n### Examples\n\n```rust\nlet changelog = \"\\\n## 0.1.2 - 2020-03-01\n\n- Bug fixes.\n\n## 0.1.1 - 2020-02-01\n\n- Added `Foo`.\n- Added `Bar`.\n\n## 0.1.0 - 2020-01-01\n\nInitial release\n\";\n\n// Parse changelog.\nlet changelog = parse_changelog::parse(changelog).unwrap();\n\n// Get the latest release.\nassert_eq!(changelog[0].version, \"0.1.2\");\nassert_eq!(changelog[0].title, \"0.1.2 - 2020-03-01\");\nassert_eq!(changelog[0].notes, \"- Bug fixes.\");\n\n// Get the specified release.\nassert_eq!(changelog[\"0.1.0\"].title, \"0.1.0 - 2020-01-01\");\nassert_eq!(changelog[\"0.1.0\"].notes, \"Initial release\");\nassert_eq!(changelog[\"0.1.1\"].title, \"0.1.1 - 2020-02-01\");\nassert_eq!(\n    changelog[\"0.1.1\"].notes,\n    \"- Added `Foo`.\\n\\\n     - Added `Bar`.\"\n);\n```\n\n\u003c!-- tidy:sync-markdown-to-rustdoc:ignore:start --\u003e\n\nSee [documentation](https://docs.rs/parse-changelog) for more information on\n`parse-changelog` as a library.\n\n\u003c!-- tidy:sync-markdown-to-rustdoc:ignore:end --\u003e\n\n\u003c!-- omit in toc --\u003e\n### Optional features\n\n- **`serde`** — Implements [`serde::Serialize`] trait for parse-changelog types.\n\n## Supported Format\n\nBy default, this crate is intended to support markdown-based changelogs\nthat have the title of each release starts with the version format based on\n[Semantic Versioning][semver]. (e.g., [Keep a Changelog][keepachangelog]'s\nchangelog format.)\n\n\u003c!-- omit in toc --\u003e\n### Headings\n\nThe heading for each release must be Atx-style (1-6 `#`) or\nSetext-style (`=` or `-` in a line under text), and the heading levels\nmust match with other releases.\n\nAtx-style headings:\n\n```markdown\n# 0.1.0\n```\n\n```markdown\n## 0.1.0\n```\n\nSetext-style headings:\n\n```markdown\n0.1.0\n=====\n```\n\n```markdown\n0.1.0\n-----\n```\n\n\u003c!-- omit in toc --\u003e\n### Titles\n\nThe title of each release must start with a text or a link text (text with\n`[` and `]`) that starts with a valid [version format](#versions) or\n[prefix format](#prefixes). For example:\n\n```markdown\n# [0.2.0]\n\ndescription...\n\n# 0.1.0\n\ndescription...\n```\n\n\u003c!-- omit in toc --\u003e\n#### Prefixes\n\nYou can include characters before the version as prefix.\n\n```text\n## Version 0.1.0\n   ^^^^^^^^\n```\n\nBy default only \"v\", \"Version \", \"Release \", and \"\" (no prefix) are\nallowed as prefixes.\n\nTo customize the prefix format, use the [`Parser::prefix_format`] method (library) or `--prefix-format` option (CLI).\n\n\u003c!-- omit in toc --\u003e\n#### Versions\n\n```text\n## v0.1.0 -- 2020-01-01\n    ^^^^^\n```\n\nThe default version format is based on [Semantic Versioning][semver].\n\nThis is parsed by using the following regular expression:\n\n```text\n^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z\\.-]+)?(\\+[0-9A-Za-z\\.-]+)?$|^Unreleased$\n```\n\n\u003e [!NOTE]\n\u003e To get the 'Unreleased' section in the CLI, you need to explicitly specify 'Unreleased' as the version.\n\nTo customize the version format, use the [`Parser::version_format`] method (library) or `--version-format` option (CLI).\n\n\u003c!-- omit in toc --\u003e\n#### Suffixes\n\nYou can freely include characters after the version.\n\n```text\n# 0.1.0 - 2020-01-01\n       ^^^^^^^^^^^^^\n```\n\n## Related Projects\n\n- [create-gh-release-action]: GitHub Action for creating GitHub Releases based on changelog. This action uses this crate for changelog parsing.\n\n[`Parser::prefix_format`]: https://docs.rs/parse-changelog/latest/parse_changelog/struct.Parser.html#method.prefix_format\n[`Parser::version_format`]: https://docs.rs/parse-changelog/latest/parse_changelog/struct.Parser.html#method.version_format\n[create-gh-release-action]: https://github.com/taiki-e/create-gh-release-action\n[keepachangelog]: https://keepachangelog.com\n[semver]: https://semver.org\n\n\u003c!-- tidy:sync-markdown-to-rustdoc:end --\u003e\n\n## License\n\nLicensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or\n[MIT license](LICENSE-MIT) at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiki-e%2Fparse-changelog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaiki-e%2Fparse-changelog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiki-e%2Fparse-changelog/lists"}