Auto-Numbering of Example Code

I stumbled upon this link while reading the review of Apple’s new Safari browser over at Dive Into Mark.  Anyway, here’s a trick to automatically add line numbers to your code examples.  I tried it out over on one of my other posts, but it doesn’t really work well for my purposes.  Partly, it’s a matter of pMachine automatically adding line breaks after the </li> tags, which made the display bad.  It also has the big drawback that when you copy-paste text, the line numbers come with it.

Anyway, it’s certainly an interesting idea and I like the concept.  The execution just doesn’t work for me.

This is an older entry and as such, it may be by a guest author or contain formatting problems / extraneous code. If you notice something wrong with the entry, please use the Contact page to let me know the entry title and issue.

Leave Your Comment

Comments may be edited for content or deleted at any time. Civilized discussion is welcome. Anyone spamming, going way off topic, or otherwise being a jerk will probably be deleted or banned.

User Information

pMcode is allowed for comment formatting. pop-up mini reference

Personalization Options

Comment Security