itwinjs-core icon indicating copy to clipboard operation
itwinjs-core copied to clipboard

Auto fix main header's anchor tag for release's table of contents

Open hl662 opened this issue 1 month ago • 4 comments

Seems like a few of us use helper markdown extensions in vscode to generate table of contents for NextVer.md. However, we run into a problem in version-bump.yaml: There's a section in version-bump.yaml that replaces mentions of 'NextVersion' in the nextver.md with the new minor version (e.g '5.4.0 Change Notes'). This script doesn't accommodate when those mentions is part of a markdown header link, resulting in this: image

We can tweak our automated script in version-bump.yaml to avoid this in the future. The updated powershell script will identify any potential nextversion anchor tag and transform it to the right markdown format.

Before transform:

publish: false
---
# NextVersion

- [NextVersion](#nextversion)
  - [Display](#display)

After transform (using the next minor version as example):

---
deltaDoc: true
version: '5.5.0'
---

# 5.5.0 Change Notes

- [5.5.0 Change Notes](#550-change-notes)
  - [Display](#display)

hl662 avatar Dec 08 '25 18:12 hl662

@GytisCepk commit history showed you generated the TOC for 5.4 first previously, can you test this branch locally (i.e add the omit from toc comment to next ver and try generating the TOC with your extension Edit: Ignore this its not relevant anymore

hl662 avatar Dec 08 '25 18:12 hl662

Is this really the right solution? Go to https://www.itwinjs.org/changehistory/#540-change-notes I would like the hyperlinks for the releases so we can link to it as needed

aruniverse avatar Dec 08 '25 18:12 aruniverse

@GytisCepk commit history showed you generated the TOC for 5.4 first previously, can you test this branch locally (i.e add the omit from toc comment to next ver and try generating the TOC with your extension Edit: Ignore this its not relevant anymore

I don't use any extension to add TOC. I added one by hand based on previous versions

GytisCepk avatar Dec 09 '25 09:12 GytisCepk

I ran a test script under a separate branch, using a test yaml job in a private Azure DevOps test pipeline, and published the original NextVersion.md and what the next minor, 5.5.0.md file will be. TLDR: The transform works

hl662 avatar Dec 09 '25 15:12 hl662