[Vim-l] Tip templates project
John Beckett
johnb.beckett at gmail.com
Wed Oct 24 23:57:58 UTC 2007
Santhalus wrote:
> I think it's a very clever idea. Right now, awfully lots of
> imported tips are completely broken and this will hopefully
> remedy this situation.
Thanks for the feedback. Yes, I fixed two tips broken by '|' last week, and
the new template business would eliminate that.
I'm hoping people will look at the examples mentioned on my user page, and
speak up if they don't like the appearance. I will start the transition in a
couple of days, so this is a hint to anyone that they should speak now or
forever hold their peace.
> Just one minor issue regarding the navigation: when I press
> 'Random page' I am sometimes directed to a OriginalMissing
> page.
Ugh. I'm afraid that is an unforeseen side effect of what I did earlier. The
current plan will have no effect.
My guess is that "random page" picks any page in the main namespace. If that
page is a redirect, another is picked.
Previously, the 200 missing tips had no wiki page. For example, the VimTip56
redirect page previously redirected to a single "tip is missing" page. All
missing tips redirected to the same "tip is missing" page, so there was a
low probability that "random page" would hit it.
My previous efforts have greatly improved tip navigation. If you are at
VimTip55 you can press 'Next tip' to go to VimTip56, which is NOT a
redirect, but is an individual page explaining that tip 56 is missing, with
a link to the original vim.org location so a persistent reader could verify
that tip 56 really did not exist. There are also links to the previous and
next tips.
However, because VimTip56 is now a real page rather than a redirect, it is
available for "random page". I don't know if we can overcome that problem. I
was going to investigate it later. I imagine one would need to either read
the wikia source code (I assume it's available somewhere), or find someone
who understood it. Then you could see how "random page" works, and whether
there is some way to disqualify pages from being a random target. There are
200 missing tips, 15 missing because they were duplicates, and we have
removed another 60. That's 275 pages for "random page" to hit.
BTW the current project will further improve tip navigation. If you are at
VimTip55, the next real tip is 58. That's where you will go if you press
"Next tip" on 55.
If the Next argument is missing, there will be an ugly mess including
"{{{Next}}}" visible in the tip navigation, and the navigation won't work. I
decided that was acceptable because a script will be inserting Next/Previous
in each tip and there won't be any missing items. Moreover, if I were run
over by a bus and Next/Previous were never updated, the wiki would still be
ahead because the Next/Previous will never be totally wrong. For example, if
tip 58 is ever deleted, then pressing "Next tip" on 55 would go to VimTip58
which would say "this tip has been removed". If someone cared, they could
manually change the Next link in 55, or my update script could do it
automatically.
You can see the ugly "{{{Next}}}" stuff if you edit tip 1151 and remove
"Next=1152", then press "Show preview". I thought it better to keep the
templates extremely simple, and to plainly show that there is a problem,
rather than to do complex calculations to evaluate 1152 if Next is missing.
Templates do NOT have a good way of doing what would be simple in a script.
As evidence, here is the quite simple Template:Help :)
<includeonly>[http://vimplugin.sourceforge.net/cgi-bin/help?tag={{{tag|{{url
encode:{{{1|{{{id}}}}}}}}}}} :help
{{{2|{{{label|{{{1|{{{id}}}}}}}}}}}}]</includeonly><noinclude>{{/doc}}
</noinclude>
John
More information about the Vim-l
mailing list