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

Readthedocs Theme: Force break of inline code #313

Closed
ePirat opened this issue Jan 4, 2015 · 8 comments · Fixed by #400
Closed

Readthedocs Theme: Force break of inline code #313

ePirat opened this issue Jan 4, 2015 · 8 comments · Fixed by #400

Comments

@ePirat
Copy link

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
Copy link
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
Copy link
Author

ePirat commented Jan 6, 2015

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

@tomchristie
Copy link
Contributor

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

@ePirat
Copy link
Author

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
Copy link
Contributor

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
Copy link
Member

d0ugal commented Jan 6, 2015

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

@ePirat
Copy link
Author

ePirat commented Jan 6, 2015

Currently:

Screenshot of current behaviour

With word-wrap: break-word;

Screenshot

@tomchristie
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants