conventional-changelog / standard-version

:trophy: Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org
ISC License
7.61k stars 789 forks source link

Allow specifying some templates for CHANGELOG generation #250

Open Morishiri opened 6 years ago

Morishiri commented 6 years ago

Hi,

I noticed that CHANGELOG is not generated properly when I'm using my company's bitbucket server. It would be nice to have a possibility to specify a template for generating e.g. compare-changes or commits URLs.

I'm aware that this issue would need to be propagated to few projects underneath, but I think it's worth it.

tmorehouse commented 5 years ago

I'm having a similar issue, and would love to be able to specify a template for the change log entries.

Currently is produces invalid (in the sense of semantic markup) heading level nesting (i.e. # instead of ##, and nesting ### directly under a #).

The change log should only have a single # heading at the top, all versions should be ## headings, and change types (i.e. docs, fixes, features, etc) should be ### headings

As well, the heading IDs, which are auto-generated from the release version, start with a number, which in HTML spec is invalid.

The auto IDs generated for ### headings are identical for each version (i.e. fix, feature, etc), which makes it hard to link to a specific section.

Currently we have to use a hook method and run the changelog through sed (or replace) to fix these issues... would be nice to be able to fix them before the change log is generated via templates.

florisporro commented 5 years ago

Just want to express interest into changelog templates as well. I was working on implementing standard-version for our desktop app built with Electron, and figuring out ways to use the generated changelog to give our users changelog messages. It's not an open-source project though, and our users have no need for links to a GitHub repo they can't access.

I'd also like a way to replace the standard header text included in the changelog. A good workaround might be for standard-version not to add any header text if CHANGELOG.md already exists?

tmorehouse commented 5 years ago

I know one can pass custom templates to conventional-changelog (as well as presets), but it would be nice to be able to pass the template option via conventional-version.

alanivey commented 4 years ago

Thank you, @tmorehouse, for sharing. I, too, was wanting to drop the h3 headers for patches to h2. If anyone else stumbles upon this, I added the following to my .versionrc.json:

{
  "scripts": {
    "postchangelog": "sed 's/### \\[/## [/g' -i CHANGELOG.md"
  }
}
alvis commented 4 years ago

Just as a note to anyone who is looking for the solution. Actually standard-version has already got a --preset flag which is not documented. Just supply the preset, such as jquery, you want to use and voila!

phrohdoh commented 3 years ago

Customizing per-version headers would be useful, too (e.g. to not have the date which makes linking to a particular version in the changelog dependent upon knowing the release date as well as the version).