Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert changelog to Markdown (MyST) #671

Merged
merged 6 commits into from
Oct 30, 2023

Conversation

astrojuanlu
Copy link
Contributor

Closes #483.

I tried to amend the release scripts, but I haven't tested them. Happy to lend a hand for the first dry run.

I resisted the temptation to convert all the documentation to MyST :) but now it's possible thanks to https://github.com/executablebooks/rst-to-myst.

One minor caveat is that now CHANGES.md titles start with ## because Markdown doesn't have (to my knowledge) the concept of "semantic headings".

Copy link
Member

@alcarney alcarney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I’ve requested a few tweaks but nothing major :)

I resisted the temptation to convert all the documentation to MyST :)

Full disclosure, I’ll probably keep the majority of the docs in rst format (personally, I prefer the syntax 😅). That said, if someone came along and wanted to contribute a new section to the docs and did it in markdown I’d happily accept it - it would be good to have examples of both syntaxes to be able to dogfood the server’s support of both styles :)

Thanks so much for taking the time to contribute this!

@@ -212,20 +212,20 @@ def generate_changelog(component: Component, version: str):

# Release notes for github
run(
"rst2html.py",
"myst-docutils-html",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the release notes are in markdown, I suspect converting them to html is now unnecessary. Would you mind removing this this step and changing draft_file to point at pathlib.Path(component[‘src’]) / ‘.changes.html’ instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, towncrier build --draft produces Markdown now, so it's not entirely clear to me why the draft file should be changes.html. I'm going ahead and changing it though.

A test:

❯ pushd lib/esbonio && towncrier build --draft --version 0.16.3 && popd
Loading template...
Finding news fragments...
Rendering news fragments...
Draft only -- nothing has been written.
What is seen below is what would be written.

## v0.16.3 - 2023-10-29


### Breaking Changes

- Removed ``esbonio.lsp.spelling`` module, though it will be available as ``esbonio.ext.spelling`` via the ``esbonio-extensions`` package. ([#583](https://github.com/swyddfa/esbonio/issues/583))
- Drop Python 3.7 support ([#584](https://github.com/swyddfa/esbonio/issues/584))
- Drop Sphinx 4.x support ([#585](https://github.com/swyddfa/esbonio/issues/585))



  ~/Projects/Personal/esbonio  changelog-markdown !2 ·····················································································  .env 20:14:53
❯ 

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

It doesn’t necessarily matter what the draft file is called, it just so happens that the release pipelines are currently configured to look for a file with that name - it seemed easier to keep the file name consistent rather than try updating all the pipelines to use something else.

.github/workflows/lsp-release.yml Outdated Show resolved Hide resolved
@astrojuanlu
Copy link
Contributor Author

Unsure if the MyPy failures are my own 🤔

scripts/make_release.py Outdated Show resolved Hide resolved
@alcarney
Copy link
Member

Unsure if the MyPy failures are my own

No, they’re pre-existing failures - I’ve only recently added mypy checks against the scripts/ folder so there’s still some things to clean up there.

@alcarney alcarney merged commit b6900f6 into swyddfa:develop Oct 30, 2023
11 checks passed
@astrojuanlu astrojuanlu deleted the changelog-markdown branch October 30, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch Changelog Format to Markdown
2 participants