small medium large xlarge

Back to: All Forums  CoffeeScript
04 May 2011, 12:00
Ben Maddox (1 post)

I was reading through the early parts of the book on my Kindle. I noticed a couple things in the .mobi version on Kindle (2nd gen).

  1. The line: console.log impatient ? useBackticks() : learnCoffeeScript()
    does not wrap. On the next to smallest font size in portrait mode, some of that line is never shown.

  2. The other text in the same box is smaller than the rest and makes it a little more challenging to read.

That said, it is a good start. I’ll continue to read and learn.

08 May 2011, 15:42
Michael Swaine (67 posts)

I’ve noticed some code wrapping problems in the .mobi, too. We’ll address these.

23 Jun 2011, 06:39
Kristoffer Roupé (3 posts)

+1 Most of the code formatting needs to be revisited. Especially long lines.

13 Jul 2011, 01:40
Dave Thomas (344 posts)

So, here’s the question: if we allow the code to be wrapped, we have no control over where it happens, so we can’t insert markers to say ‘this line continued below’. And, with many languages, including CoffeeScript, newlines are significant syntactically.

So, if we let the device wrap code, you get incorrect listings. If we don’t allow wrapping, you get truncated listings.

Which is the lesser evil?


25 Jul 2011, 17:33
Rhys Brett-Bowen (1 post)

I would rather have incorrect listings, at least these can be debugged when trying to run the code. Otherwise it’s guesswork as to what the rest of the code should be.

27 Jul 2011, 14:39
Antoni S. Puimedon (1 post)

I think I’m also for incorrect listings. Isn’t there a way to style the wrapped part somehow differently than the rest of the code listing?

21 Aug 2011, 19:40
Trevor Burnham (54 posts)

One fix would be for the build system to wrap lines but with a \ at the end. Readers should be able to infer what that means, and the code will still work if interpreted literally (at least in CoffeeScript).

By the way, I’ve heard some complaints that indentation isn’t working correctly in the ePub format on some devices:!/trevorpower/status/105359810727395328 Anyone else experiencing this?

05 Sep 2011, 04:42
Dave Thomas (344 posts)

You can’t add a \ at the end of the line on a Kindle—there’s no way of knowing ahead of time where the end is.

However, we’ve changed the way we wrap Kindle code—it now should wrap and indent the wrapped part. This change will be reflected in books as we release updated versions.


10 Nov 2013, 07:39
Tamara Temple (2 posts)

I would really love to know when code wrapping will be addressed for this book (Coffeescript). It is a serious impingement on my reading this ebook.

  You must be logged in to comment