3 ms·
Best practice for formatting code in blog posts
- streety 18y agoThe result really isn't any better than what most blogs have. Yes it's highlighted and yes there is a horizontal scroll bar at the bottom to accommodate long lines but that seems fairly standard today.
- j_b_f 18y agoWhat I care about is not having the line numbers in there. Makes copying-and-pasting a huge pain.
- philjr 18y agoI know I've seen code with formatted line numbers in places that still allowed proper c'n'p functionality. I can't think where though.
- streety 18y agoI was under the impression that a work around had been found for that but as I'm unable to find a tutorial or any discussion I could have imagined it. Having to strip the line numbers out is a real pain. I agree totally with you on that. However, as the presence of line numbers is normally configurable in the highlighting plugins I still see nothing new here.
- jrockway 18y agoStripping the line numbers is not that difficult. In emacs, position the point at the beginning of the document, then hit M-> to go to the end, then move the point to the first non-line-number character, then hit C-x r k. Problem solved.
- MarcusL 18y ago@streety: Didn't mean to break new ground, just recommend the best plugin I found so people don't have to go looking around for themselves. @philjr: Some of the flash/javascript that does copy & paste without pulling the numbers doesn't work in Google Reader and many other aggregators.