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

Strip leading and trailing space per line (maybe?) #312

Open
altendky opened this issue Jan 9, 2021 · 1 comment
Open

Strip leading and trailing space per line (maybe?) #312

altendky opened this issue Jan 9, 2021 · 1 comment

Comments

@altendky
Copy link
Member

altendky commented Jan 9, 2021

#311

The leading spaces resulted in some odd formatting as the first line got it's leading space stripped and the second and third did not. On the one hand, this was presumably not intended here. On the other, making it impossible to create that result means you can't... achieve that result. Maybe strip leading and trailing whitespace from each line? Maybe do a textwrap.dedent instead? Or maybe it isn't that big a deal and you should just look at your resulting newsfile...

In my other projects this would have (theoretically) been caught in the initial PR that added the newsfragment as the readthedocs PR build would have run towncrier and we would have checked the formatting in the result as part of review.

So, this is documented but I'm not certain either way that this behavior should or should not be changed.

@adiroiban
Copy link
Member

My understanding is that the content of each news-fragment is exactly one release note item.

From inside the news-fragment file you don't control where that list item is presented on the page,

My understanding is that towncrier should perform the following operations:

  • strip (leading/trailing) each line from the file.
  • merge all lines from the news-fragment file into a single line replacing newlines with space character
  • reformat the line / re-rewrap to match the final file format.

Make sense?

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

No branches or pull requests

2 participants