On 03/05/09 08:24, Wu, Yue wrote:
>
> On Sun, May 03, 2009 at 02:50:52AM +0200, Tony Mechelynck wrote:
>>
>> On 01/05/09 00:11, Wu, Yue wrote:
>>>
>>> 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.
>>
>
> We can make things simple: make all *foo* become<target=foo>*foo*</taget>,
> and all |foo| to<ref=foo>|foo|</ref>
>
> *foo* => <target=foo>*foo*</taget>
>
> |foo| => <ref=foo>|foo|</ref>
>
> I don't know html, it's my wrongly syntax example :)
>
> Though maybe fully hyperlink support is complicated, but we can support some
> simple cases firstly.
>
If you don't know HTML, then the correct syntax would be
<a name="foo" id="foo">*foo*</a>
<a href="#foo">|foo|</a>
<a href="#'foo'">'foo'</a>
if they are in the same file, though I think those link names (value of
the name= id= href= attributes) cannot contain almost any characters the
way Vim help tags do. In particular they can certainly not contain a #
character since it separates the URL from the label in the href attribute.
For a target in a different file, it would be
<a href="bar.txt#foo">|foo|</a>
etc., using a "relative URL", relative to the directory of the file
where the href link is found.
Best regards,
Tony.
--
Violence is the last refuge of the incompetent.
-- Salvor Hardin
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---