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

Badges and separate lines in the same paragraph #38

Open
anacrolix opened this Issue Oct 9, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@anacrolix

anacrolix commented Oct 9, 2017

I ran this on some project READMEs, and one interesting case is what it does to the badges. When writing these out by hand, it's easy to put them on separate lines, without a blank line between them, which renders them in the same paragraph, and makes them easy to maintain. But the tool merges them to the same line, which doesn't seem desirable.

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Oct 11, 2017

Member

I understand what you're referring to.

I can suggest two alternatives that would work:

  1. Have the badges on the same line, space separated. It's consistent with the rendering as HTML. It's what I do in most READMEs, including the one in this repository. Downside might be that they're harder to maintain, as you said, but I change badges infrequently.

  2. Put 2 spaces at the end of each line to preserve the trailing newline. Like this:

    [![Build Status](https://travis-ci.org/...)](https://travis-ci.org/...)<space><space>
    [![GoDoc](https://godoc.org/...)](https://godoc.org/...)<space><space>

    Where <space> is just a space ().

Member

dmitshur commented Oct 11, 2017

I understand what you're referring to.

I can suggest two alternatives that would work:

  1. Have the badges on the same line, space separated. It's consistent with the rendering as HTML. It's what I do in most READMEs, including the one in this repository. Downside might be that they're harder to maintain, as you said, but I change badges infrequently.

  2. Put 2 spaces at the end of each line to preserve the trailing newline. Like this:

    [![Build Status](https://travis-ci.org/...)](https://travis-ci.org/...)<space><space>
    [![GoDoc](https://godoc.org/...)](https://godoc.org/...)<space><space>

    Where <space> is just a space ().

@anacrolix

This comment has been minimized.

Show comment
Hide comment
@anacrolix

anacrolix Oct 11, 2017

Option 2 results in the badges on different lines. Is there a strong need to merge text in the same paragraph on different markdown lines?

anacrolix commented Oct 11, 2017

Option 2 results in the badges on different lines. Is there a strong need to merge text in the same paragraph on different markdown lines?

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Oct 11, 2017

Member

You're right, option 2 will give different behavior.

It had to be done in some way. I considered it for some time:

//extensions |= blackfriday.EXTENSION_HARD_LINE_BREAK

But ended up choosing to go without EXTENSION_HARD_LINE_BREAK option.

It was mostly motivated by the desire
to have manually wrapped text become
automatically wrapped text, so that it
would be readable even as you resize
the width of your editor. E.g., this
paragraph would become a normal
paragraph instead of a narrow one.

Option 1 still works.

Member

dmitshur commented Oct 11, 2017

You're right, option 2 will give different behavior.

It had to be done in some way. I considered it for some time:

//extensions |= blackfriday.EXTENSION_HARD_LINE_BREAK

But ended up choosing to go without EXTENSION_HARD_LINE_BREAK option.

It was mostly motivated by the desire
to have manually wrapped text become
automatically wrapped text, so that it
would be readable even as you resize
the width of your editor. E.g., this
paragraph would become a normal
paragraph instead of a narrow one.

Option 1 still works.

@anacrolix

This comment has been minimized.

Show comment
Hide comment
@anacrolix

anacrolix Oct 11, 2017

Do you want to reconsider that extension or expose a command-line flag?

anacrolix commented Oct 11, 2017

Do you want to reconsider that extension or expose a command-line flag?

@dmitshur dmitshur added the thinking label Oct 12, 2017

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Oct 12, 2017

Member

I can reconsider the extension, but I won't be adding command-ling flags. I want to maintain the zero-configuration property of the formatting tool, just like gofmt.

It will take me a while to think about whether that extension is a good idea. If you'd like to have it sooner, I suggest you make a fork and apply the change there for your own needs. That would be helpful, because you could also provide feedback on how well it works in your experience.

Member

dmitshur commented Oct 12, 2017

I can reconsider the extension, but I won't be adding command-ling flags. I want to maintain the zero-configuration property of the formatting tool, just like gofmt.

It will take me a while to think about whether that extension is a good idea. If you'd like to have it sooner, I suggest you make a fork and apply the change there for your own needs. That would be helpful, because you could also provide feedback on how well it works in your experience.

@anacrolix

This comment has been minimized.

Show comment
Hide comment
@anacrolix

anacrolix commented Oct 12, 2017

Thanks

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