Hacker News new | ask | show | jobs
by lecarore 1874 days ago
I guess one could use prettier with different max line lengths on the same code, then hide irrelevant versions with a media query. Feels a bit overengineered TBH

Alternatively, on a mobile device, you could try to display the "desktop view" and put your phone in landscape mode.

3 comments

That's... actually a brilliant idea, in my opinion. Overengineered? Idk, seems like something you'd have to implement once with like 100 lines of glue code for different libraries and then it could just work. And it could seriously benefit mobile viewers. Personally I read a lot of programming blogposts on my phone while commuting etc.
ideally, there should be one content and exclusively handled with styling.

maybe using some combination of pre tags and white-space pre-wrap

It may be possible to use `<wbr>` in a single representation, assuming the indentation is solvable.