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

Standardize line lengths between books and source #219

Closed
hollasch opened this issue Oct 19, 2019 · 4 comments
Closed

Standardize line lengths between books and source #219

hollasch opened this issue Oct 19, 2019 · 4 comments
Assignees
Milestone

Comments

@hollasch
Copy link
Collaborator

Code lines in the books are restricted in order to avoid requiring the reader to horizontally scroll to see all of the code. This means that some lines wrap differently between the source and books, which is unfortunate when trying to compare them.

Revisit the book line lengths for source code, adjusting with CSS or other means. Then reformat the source code to the same line length.

@hollasch hollasch added this to the v3 milestone Oct 19, 2019
@hollasch hollasch self-assigned this Oct 19, 2019
@hollasch
Copy link
Collaborator Author

hollasch commented Oct 28, 2019

100 characters would be nice. I could accomplish this in Brave (≅ Chrome), by reducing the code font size from 86% to 84%, and the letter spacing (tracking) by -0.20px. However, this isn't enough in Firefox, which is pretty discouraging. In addition, when saving as PDF from the browser in Brave/Chrome, you need to set margins to minimum.

It's looking like 86 characters per line may be the best compromise across viewers. Still need to test on Edge/IE and Safari.

92 characters / line might be achievable.

Oh, and further complication comes from using different fonts across platforms.

@trevordblack
Copy link
Collaborator

trevordblack commented Oct 29, 2019 via email

@hollasch
Copy link
Collaborator Author

Markdeep is just a JavaScript payload that transforms the Markdown source to standard HTML. Since the end result is HTML, you can style it with regular old CSS, which is what the above does. I do chat with Morgan these days about Markdeep, but there's nothing that can be done at that level that HTML+CSS can't do.

The challenges above are just regular wrestling with a result rendered across a variety of browsers and configurations. I'm going to cobble up some test cases for us all to try out just to get a good sense of coverage. However, there won't be a one-size-fits-all solution waiting for us. Our best hope is to get a solution that works for most.

@hollasch
Copy link
Collaborator Author

hollasch commented Nov 5, 2019

Resolved in development branch, PR #247

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