On 01/05/09 00:11, Wu, Yue wrote:
> On Thu, Apr 30, 2009 at 07:05:53AM -0700, Ben Fritz wrote:
>> On Apr 29, 10:22 pm, "Wu, Yue"<[email protected]>  wrote:
[...]
>>> new feature request comes :) If 2html supports translating the tags jumping
>>> to hypertext, it would be much more great.
>>>
>>
>> I think this would be extremely difficult to do right in Vim script,
>> and it is hard to tell exactly how to go about it. I think it would be
>> far beyond the scope of 2html.vim, and additionally (if I understand
>> you correctly) this is a task that is already accomplished by many
>> readily available tools. Just do a google search or poke around on
>> sourceforge. "Tags jumping" is kind of open to interpretation, so I'm
>> not sure exactly what you want, but there are tools to create html
>> with embedded links, tree views, etc. based on all sorts of plaintext
>> documents.
>
> I don't know the web relating technology, but I think 2html can use the tag
> file of the current document, and then make all |foo| and *foo* in the
> document as a hypertext? Is it hard to implement?
>

Well, in Vim help files, |this| is indeed a link, but so is 'that'. 
However, where it gets complicated is that not only [range] is a link, 
but also that you can double click (or hit Ctrl-] on) any word anywhere 
in the help text, and if there is a tag by that name (or if there isn't, 
a tag containing that name) you'll be brought to it. But if you 
linkified any word which appeared as a tag, you'd sometimes get 
preposterous results. For instance, in the HTML help 
http://vimdoc.sourceforge.net/htmldoc/ any occurrence of the pronoun 
"it" is linkified, because there is a text object named "it" (inner HTML 
tag block) and it has a tag.

But tags are not limited to the Vim help. You can use ctags to generate 
tags files for source programs in most languages, and then you can click 
any use of any identifier anywhere in the source, and see where it was 
defined (provided of course, that the source file containing the 
definition was one of those analyzed by ctags to produce this tagfile). 
Now an identifier can be almost any word (and, if it is e.g. a 
variable-name, it doesn't particularly stand out the way function names 
do by virtue of being followed by an open bracket).


Best regards,
Tony.
-- 
There is a theory that states: "If anyone finds out what the universe
is for it will disappear and be replaced by something more bazaarly
inexplicable."

There is another theory that states: "This has already happened ...."
                -- Douglas Adams, "Hitch-Hikers Guide to the Galaxy"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui