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

Split item into multiple lines with correct markdown #8

Open
yarikoptic opened this issue Oct 12, 2022 · 11 comments
Open

Split item into multiple lines with correct markdown #8

yarikoptic opened this issue Oct 12, 2022 · 11 comments
Assignees
Labels

Comments

@yarikoptic
Copy link
Member

yarikoptic commented Oct 12, 2022

wrapping was removed since it was wrong but it is simple to just manually format it into multiple lines separating issues, prs and author like here https://github.com/datalad/datalad/pull/7084/files#diff-24339cbbf16b5fd0f274663820dcd77c38106994445a197aa748b79ebb3073f8R7

- Describe change, possibly reference closed/related issue/PR.
  Fixes [#XXX](https://github.com/datalad/datalad-next/issues/XXX) via
  [PR #YYY](https://github.com/datalad/datalad-next/pull/YYY)
  (by [@GITHUBHANDLE](https://github.com/GITHUBHANDLE))

since single line is indeed too long/hard to grasp when looking at changelog

@jwodder
Copy link
Member

jwodder commented Oct 12, 2022

@yarikoptic The reason we removed the wrapping was because, when the changelog entries were used in the body of a GitHub release, GitHub treats newlines in release bodies as hard breaks (the same as it does in issue & PR comments), so your sample wrapped text would show up as:

@yarikoptic
Copy link
Member Author

ha -- so points to the typo - added [ before @ in example and that PR.

And indeed I now vaguely remember that suboptimal rendering for github releases. Have we discussed possibility to submit a desiire to scriv to reformat them for the github release e.g. to "dewarp" somehow or you do not see it feasible?

Otherwise we would be doomed to either have quite suboptimally formatted github release entries or changelog entries, or I might be missing smth? (note: scriv itself uses CHANGELOG.rst not .md and somehow there is no such problem -- github releases look ok and changelog has them nicely paragraphed, so might me .md specific issue. Unless you see some reason, please clarify with scriv .

@jwodder
Copy link
Member

jwodder commented Oct 13, 2022

@yarikoptic

Have we discussed possibility to submit a desiire to scriv to reformat them for the github release e.g. to "dewarp" somehow

No.

or you do not see it feasible?

I think "dewarping" properly would require a full-fledged GitHub-Flavored Markdown parser, but one could probably handle 90%+ of cases with something like re.sub(r'(?<=\S)(\r?\n[ \t]+)+(?=\S)', ' ', body).

Scriv converts reStructuredText changelogs to Markdown for GitHub Releases using Pandoc with the --wrap=none option, which is presumably why their release bodies look fine.

@yarikoptic
Copy link
Member Author

well, may be the same pandoc -frst -tmarkdown_strict --markdown-headings=atx --wrap=none could be applied to produced markdown entries to dewrap them in the same uniform fashion?

@jwodder
Copy link
Member

jwodder commented Oct 13, 2022

@yarikoptic Even if it could, we wouldn't be able to apply that ourselves (if that's what you're suggesting) without either duplicating scriv's changelog-section-extraction or else editing the release notes after the release is created.

@yarikoptic
Copy link
Member Author

I mean that we should suggest it to scriv in an issue describing current problem with formatted .md entries if posted like that to github release.

@jwodder
Copy link
Member

jwodder commented Oct 13, 2022

@yarikoptic Feature request filed: nedbat/scriv#66

@yarikoptic
Copy link
Member Author

Echoing my question in nedbat/scriv#66 (comment) I think we should just do it (call pandoc on the found .md snippets) in this action code, unless you see some cons from doing that? It is ok for us to run time depend on pandoc.

@jwodder
Copy link
Member

jwodder commented Oct 24, 2022

@yarikoptic You want to use pandoc with the --wrap=none option to remove line wrapping, correct? That would result in long lines in the CHANGELOG, which I thought you didn't want.

@yarikoptic
Copy link
Member Author

Doh right! Dewarping really should be done by scriv, eh, let's forget about pretty GitHub release notes until scriv allowed y for them

@jwodder
Copy link
Member

jwodder commented Dec 8, 2022

Blocked by nedbat/scriv#66.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants