Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Best practice for formatting code in blog posts (blurpr.com)
7 points by j_b_f on April 8, 2009 | hide | past | favorite | 6 comments


@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.


The 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.


What I care about is not having the line numbers in there. Makes copying-and-pasting a huge pain.


I 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.


I 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.


Stripping 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: