[Vim-l] Template:Help - Alternatives
John Beckett
johnb.beckett at gmail.com
Thu Jun 28 00:29:30 UTC 2007
Sebastian Menge wrote:
> sorry if i was offending
Thanks, but I'm only offended when ignored<g>.
> So if the query should be urlencoded, the help template had to
> do it when calling the help-script. In the script itself, we
> must suppose the data is correct.
Yes. Perhaps make Template:Help2 for experimenting with this.
When happy, copy the code to Template:Help.
Note that I later want to experiment using Template:Help2 for my
alternate scheme, see below.
> we need to imitate the exact behavior of :help
File src/ex_cmds.c has functions ex_help, help_heuristic,
find_help_tags. The Vim source is new to me, but a quick look
should be enough to convince anyone that we aren't going to be
reproducing Vim :help behaviour.
I ran into something interesting:
In Vim, do ":help :helptags". That command generates the help
tags file. The code implementing this is in file ex_cmds.c,
function ex_helptags.
I think all we can do is make Template:Help work correctly most
of the time, and have Template:Help2 for exceptional cases.
There are a ton of things to do in the wiki, and gold-plating
how Help works is probably not worthwhile at the moment.
My recommendations:
1. Make Help do urlencoding (all the time - no urlencode
parameter). Use Help2 to experiment with this; copy back to Help
when satisfied.
2. Ask editors to enter the help tag with the correct case, but
make the CGI query case insensitive because there will be too
many cases where the wrong case is used (I guess). My
help-dev-jb.txt uses lower() for a case insensitive search.
3. Make a new Template:Help2 which takes two parameters. One for
display in the wiki (":help word"), the other to make the link
URL. The link would be like this (no query):
http://vimdoc.sourceforge.net/htmldoc/motion.html#word
We would only use Help2 in cases where we notice that Help
fails.
Bluesky: Later make a bot that converts Help to Help2 (and
checks that Help2 instances are correct).
Re case insensitivity (recommendation 2):
The CGI query would regard "{{help|WORD}}" and "{{help|word}}"
as the same. In this example, even a case sensitive search would
give the same result because both "WORD" and "word" are on
motion.html.
Whatever we do, the client's browser will determine whether the
help tag needs to be entered with the correct case. Some quick
experiments show:
Firefox and Konqueror are case sensitive. They go to the correct
anchor, and regard "word" and "WORD" as being different.
However, they fail to find "Word" (they go to the start of the
correct motion.html page, but they don't find the anchor). They
fail to find "<tab>" because it's actually "<Tab>".
To confirm this, put Firefox on your home page, then go to:
http://vimdoc.sourceforge.net/htmldoc/motion.html#Word
Internet Explorer is case insensitive. It thinks "word" and
"WORD" are the same (bad). It finds "Word" (good).
BTW, I notice that if you enter a URL with anchor "#<tab>"
into Firefox, it changes the anchor to "#%3Ctab%3E". In other
words, Firefox confirms that we should be using urlencode.
John
More information about the Vim-l
mailing list