-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Enable line un-wrapping of Markdown for GitHub releases #66
Comments
Is it possible to simply not wrap your original changelog fragments? |
Then it becomes one long line, harder to edit etc. And for scriv it is simply different behavior between rst (ok to consume wrapped) and markdown (not ok). |
Yes, it's one long line, so you use word wrapping in your editor. I guess I'm not sure why scriv needs to fiddle with the line wrapping. How do you edit Markdown files now so that the hard line endings aren't a problem? Or, if you have hard line endings, then how do they not become a problem when the text is on GitHub? For example, what about long commit messages? |
Dear @nedbat thanks for the quick responses. Now that I am at the keyboard let me expand on my previous reply to answer your questions/clarify the situation. As a sidenote, I think that we are dealing with a bug or peculiarity of how github reneders markdown of the itemized lists with wrapped items (pycharm is also funny - typically rewraps nicely unless previous line has 2 trailing white spaces which it takes as a signal to have clear newline there... I must read more on "markdown conventions"). But let's get back to
Well, the question is kind of back to you since it already does that for .rst - why does it fiddle with the line wrapping for .rst? And with that we can come up with answers to rest of the comments/questions you had by simply looking at https://raw.githubusercontent.com/nedbat/scriv/main/CHANGELOG.rst and sample changelog snippets as in randomly chosen 3fa23ce
So, even if there are ways and means to work with long lines, it is more cumbersome and you yourself do not do that for |
TBH, the re-wrapping for .rst is an accident: scriv uses pandoc to convert .rst to .md for GitHub releases, since GitHub will only accept markdown. In theory there's no need for pandoc to add .md changelogs to releases. I suppose we could explore using pandoc for .md->.md also, but I'd hate to require people to install pandoc if they are already writing markdown. And if they aren't required to install pandoc, then we have a condition to check? It sounds like it will be very messy. |
I see the reservation! May be it could become a config option? |
just for another little piece of motivation against one lines -- look at https://github.com/datalad/datalad/pull/7107/files#diff-4fd7661b8fcafe326f99613d1de1a7c9cd23e2f7456019eefc2f3bd3d18dd401R3 and think how it would be in 1 liner and suggest a recommendation for its change: would be more cumbersome. I really hope that there could be an option so we could simply rely on pandoc. |
FWIW, we can't do it "ourselves" since we do not want oneliners in CHANGELOG.md but want them only within github release notes since otherwise they look quite suboptimal, see e.g. https://github.com/datalad/datalad/releases/tag/0.17.9 |
@nedbat so what about a config option to trigger consistent use of pandoc? |
@nedbat ping on this issue. |
If the source for the entries in a Markdown changelog are wrapped to some number of characters, then when
scriv
uses them as the body of a GitHub release, GitHub will render the intra-paragraph newlines as hard line breaks, so that this:ends up looking like this:
Hideous!
I would thus like to ask whether it's possible for scriv to add in some sort of automatic line un-wrapping for Markdown changelogs when using them as GitHub release bodies. One possible implementation (I'm not sure if it would work) would be to send the Markdown through pandoc with the
--wrap=none
option. Alternatively, something likere.sub(r'(?<=\S)(\r?\n[ \t]+)*\r?\n[ \t]*(?=\S)', ' ', body)
might work for 90%+ of cases.The text was updated successfully, but these errors were encountered: