Standard-version: Allow specifying some templates for CHANGELOG generation

Created on 12 Jun 2018  路  6Comments  路  Source: conventional-changelog/standard-version

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.

Most helpful comment

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.

All 6 comments

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.

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?

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.

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"
  }
}

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!

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).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hotell picture Hotell  路  6Comments

vidavidorra picture vidavidorra  路  5Comments

joefraley picture joefraley  路  6Comments

roboto84 picture roboto84  路  3Comments

SteveVanOpstal picture SteveVanOpstal  路  4Comments