SHJS-Linenumbers is a project mainly written in JavaScript, it's free.
Adding linenumber support for the SHJS Syntax highlighting script.
Adding linenumbers to SHJS syntaxt highlighter
just grab src/sh_main.js
and make sure to have the right css classes styled, look at src/sh_style.css
You can also check out the example example/example.html
Distributed under the GNU General Public License version 3
http://shjs.sourceforge.net/doc/gplv3.html