mithril.js icon indicating copy to clipboard operation
mithril.js copied to clipboard

We have two change logs

Open pygy opened this issue 2 years ago • 4 comments

We currently have

  • https://github.com/MithrilJS/mithril.js/blob/next/docs/changelog.md, the legacy, hand-curated change log used to generate the docs Web site, and
  • https://github.com/MithrilJS/mithril.js/blob/next/docs/recent-changes.md, which is generated by pr-release, but not propagated to the site.

From now on, it would seem reasonable to rely on the automated logs. If pr-release is flexible enough, we could tell it to update changelog.md. If it isn't we can move the old entries to recent-changes.md and special-case that file in the build-docs script to put its content in https://mithril.js.org/changelog.html.

Edit, actually, https://mithril.js.org/recent-changes.html is live, but not linked to from anywere.

pygy avatar May 30 '22 14:05 pygy

Yep the default behaviour is to write to docs/changelog.md and it simply prepends to the existing file. The path is specified in the merge yml link

--changelog ./docs/recent-changes.md

Needs to change to:

--changelog ./changelog.md

I'll try and find time for a PR soon, but if not, that is all that needs to change.

JAForbes avatar May 30 '22 23:05 JAForbes

@JAForbes I would love to do this (easy) task.

tbreuss avatar May 31 '22 20:05 tbreuss

Sure! It is probably a bit more involved than just moving the content of recent-changes.md to changelog.md and updating the configuration, because...

  • The title structure is incompatible (I'd modify the old ones to match what PR-release does)
  • The old change log has a TOC (which is nice, but not mandatory...

If you want to try and generate one, you can have a look at https://github.com/compose-regexp/compose-regexp.js/blob/main/scripts/build-toc.js which should work with few modifications. The script currently replaces the TOC in the middle of the page, but it should instead move it back at the top after pr-release prepends its changes.

const tocMatcher = sequence(lookBehind('<!-- START toc -->\n'), /[^]*?/, lookAhead('<!-- END toc -->'))

should become

const tocMatcher = /<!-- START toc -->[^]*?<!-- END toc -->/

You can add the corresponding tags around the TOC at the start of the file, and tweak build-toc to move the TOC rather than replacing it.

(note that I'm fine not having a TOC there)

pygy avatar May 31 '22 21:05 pygy

In changelog.md is the date of release mentioned as well. In recent-changes.md this information missing. Would it be possible to add the date of the release automatically?

modir avatar Jan 04 '23 14:01 modir