Skip to content

Use rst.linker to apply date stamps to changelog entries based on SCM metadata

Jason R. Coombs requested to merge feature/inject-release-dates into master

In !9 (merged), @warsaw noticed a chicken/egg problem. This functionality from rst.linker helps alleviate that chicken/egg problem by injecting release dates into the changelog automatically. So a changelog needs only have the version number and the rest is generated.

I'm not super-happy about rst.linker. It's a real hack-job, generating a new rst file to build rather than operating at the object level in the Sphinx ecosystem. But it still does a fine job. I use it in most of my projects to save time and worry adding release dates, but allowing them to be generated (and even automatically back-dated). For example, rst.linker was conceived in 2015, but it's generating dates for setuptools history file going back to 2009.

Eventually, we may want to consider building a more robust tool to accomplish the same task, but for now, this approach is fairly sane and avoids manual and error-prone date generation.

One limitation of rst.linker is it cannot inject dates above the header line, so they must appear in the body of the changelog. I hope that's okay. Here's what the rendering looks like:

image

Edited by Jason R. Coombs

Merge request reports