Great idea. I could see how this could be a nice feature to add to some of my projects, so I did a little research and here is what I came up with:
The relevant reading in vim...
:help syntax
:help 2html
From the command line...
vim -f +"syn on" +"so \$VIMRUNTIME/syntax/2html.vim" +"wq" +"q" yourfi
+le.pl
This will create yourfile.html in the current directory. I had to tweak the resulting HTML to change the background from white to black. (Perhaps since that is what my terminal background color is, that is the colors that vim used.) I would be very interested to know if you come up with any improvements on this method.
-Nathan
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.