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

Readthedocs Theme: Force break of inline code #313

Closed
ePirat opened this Issue Jan 4, 2015 · 8 comments

Comments

Projects
None yet
3 participants
@ePirat

ePirat commented Jan 4, 2015

Using the ReadTheDocs theme, inline code

`code`

should be forced to break, so that it does not break the responsive layout.

@d0ugal

This comment has been minimized.

Member

d0ugal commented Jan 6, 2015

So, this is an issue if the line is too long? Any ideas how you would fix it in CSS?

@ePirat

This comment has been minimized.

ePirat commented Jan 6, 2015

Just use word-wrap: break-word; so it will break even in the middle of words.

@tomchristie

This comment has been minimized.

Contributor

tomchristie commented Jan 6, 2015

Wouldn't we want horizontal scrolling instead. I don't think we should ever wrap code lines.

@ePirat

This comment has been minimized.

ePirat commented Jan 6, 2015

@tomchristie I strongly disagree. Scrolling might be fine for blocks of code (even there most of the time it annoys me), but it definitely isn't for inline code.
Indentation should not matter for inline code, so I see absolutely no problem with breaking it to the next line.
What actually never should be done is logical hyphenization, i.e. if (superman) vs. if (super-[newline]man. So setting hyphens: none; might be a good idea for code.

@tomchristie

This comment has been minimized.

Contributor

tomchristie commented Jan 6, 2015

A screenshot example would probably be a good idea. I'd expect inline code to fall onto the next line as a single block if it's too long, no?

@d0ugal

This comment has been minimized.

Member

d0ugal commented Jan 6, 2015

I think the issue is when the single block is winder than the width of the device.

@ePirat

This comment has been minimized.

ePirat commented Jan 6, 2015

Currently:

Screenshot of current behaviour

With word-wrap: break-word;

Screenshot

@tomchristie

This comment has been minimized.

Contributor

tomchristie commented Jan 7, 2015

Okay, that's super helpful. Second case to compare here would be when the block is inline with text before.

Say we have...

this is some text `and-an-`
`[newline]inline-block` more text

We wouldn't want that kind of wrapping. However this makes it look to me like the break-word behavior is correct.

screen shot 2015-01-07 at 09 03 21

The long word still starts on a newline, and only breaks if it's longer than the entire viewport which is what I'd want to see.

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