I'm writing up my project report and want to include line numbers with
the code that i paste into my word doc writeup. Does anyone know of a
ruby editor for windows that will allow this? =20
Not directly, but here are a few ideas:
- jEdit (
http://www.jedit.org/) is a programmable editor (programmable
in=20
BeanShell-Java and Python), and there are many extensions available. For
example
http://taat.pl/en/jedit/#macros lists a macro Lines_to_numbered.bsh
which
is supposed (I haven't tried it) to write line numbers in front of each=20
line. You call the macro, copy the buffer, and undo the changes.
Actually, if you don't mind diving into BeanShell programming, you could
write your own macro doing this.
- Notepad++ is similar in this respect. Here you can use the plugin
"TextFX Tools", which has a command "number lines", which puts line
numbers in front of the selected text, though in just one standard
format (with leading zeroes), and I don't know how easy it is to change
this. Again, you can copy the numbered file to the clipboard and remove=20
the line numbers with Control-Z afterwards. You can download it from
http://notepad-plus.sourceforge.net/de/site.htm
- You could put the line numbering process outside of the editor, either
by writing a trivial Ruby program which creates a file with numbers out
of a text file, or using some of the utilities which are already
available
(I use, for example, Cygwin, which has the nl command for numbering the
lines). Many editors allow running an external program on the buffer -
examples are (again) jEdit, but also the vi family and, AFIK, Scite too.
HTH
Ronald
--=20
Ronald Fischer <
[email protected]>
Phone: +49-89-452133-162