Re: 2html.vim script question
- As follow-up to my own question, I played with the 2html.vim script so
that I could use it to produce html files that can be exchanged with
the "html source files" that are produced with the Java API Document
Generator (javadoc) -linksource option.
The purpose is to get syntax-highlighted source files into the javadocs.
I posted my modified script at http://www.vim.org/scripts/ as htmlj.vim.
The key change is adding the "id" attribute at the beginning of each
line of code so that:
<span class="lnr"> 11</span>
<span id="line.11" class="lnr"> 11</span>
Even though this is for javadoc, it might be useful for anyone
interested in producing html versions of source files that can display
a particular code line at the top.
The above example if contained in the file, Hello.html, would get you
to line 11 of the code using Hello.html#line.11 .
I would appreciate any comments (I tried hard not to break anything in
P.S. Since the gvim script is now working on my Mac and I replaced the
2html.vim script with my modified version (keeping the original of
course), I can generated the "javadoc" version of Hello.java (called
Hello.html) from the Terminal with this command:
gvim -c "let javadoc = 1" -c "runtime! syntax/2html.vim" -c "wq" -c "q"