Are there any ergonomic libraries for rewriting a markdown document?
I've got a changelog that follows the Keep a Changelog format and want to automate a couple boring operations:
-
Insert a new
## [v1.2.3] - 2020-02-03
header immediately after## [Unreleased]
to indicate a set of additions/changes/fixes are now part of thev1.2.3
release. -
Add a new link definition for
v1.2.3
so we can see the diff between it and the previous version (e.g.https://gitlab.com/my-company/my-project/compare/v1.2.2..v1.2.3
). -
Modify the link for
[Unreleased]
from"https://gitlab.com/my-company/my-project/compare/v1.2.2..master"
to"https://gitlab.com/my-company/my-project/compare/v1.2.3..master"
.
I could bodge this together with regex, but I'd prefer to use a more robust solution if possible.