Complex conversion issues
This is a long reply to the following IRC conversation (all times in BST):
12:47 < guillem> anyone knows offhand what the MoinMoin InterWiki links would map to in MediaWiki, would we need to do that with custom templates?
12:47 < guillem> (for ref https://wiki.debian.org/InterWiki and https://wiki.debian.org/InterWikiMap)
12:47 < guillem> (this is one of the things the conversion script is missing)
12:51 < guillem> the other things are are incomplete and will need work are: https://wiki.debian.org/HelpOnSmileys (I was looking into this the other day and didn't find anything obvious on the MediaWiki side)
12:52 < guillem> then there's already partial support for macros (https://wiki.debian.org/HelpOnMacros) but that will need adding missing ones (including Debian specific ones https://wiki.debian.org/HelpOnDebianMacros)
12:53 < guillem> and then I think also https://wiki.debian.org/HelpOnParsers and https://wiki.debian.org/HelpOnAdmonitions
12:56 < zeha> generally there is https://m.mediawiki.org/wiki/Manual:Interwiki
13:02 < Sledge> I'm not even sure the interwiki stuff is any use at all
13:02 < guillem> Sledge: I think it's used quite widely for DebianBug: and DebianPackage:
13:03 < Sledge> argh, ok
13:03 < guillem> I think for DebianBug there's even some magic that checks whether the bug has been closed, and strikes it (which is also nice), but I'm not sure that can be translated into MediaWiki
13:04 < Sledge> sure, now you mention it
13:05 < guillem> in any case I'm fine with whatever we decide, it's just that converting to anything (even if we'd end up deciding on hardcoded URLs, is going to be easier if done during mass conversion)
# InterWiki links
zeha mentioned InterWiki links, although they seem to require database work[1].
If you convert these to a template like {{InterWiki|DebianBug|12345}},
the template can render them as interwiki links if we get that to work,
or failing that it can do the job with some moderately clever template logic.
HelpOnLinking talks about adding parameters to links like this:
[[SomePage|{{attachment:samplegraphic.png}}|target="_blank"]]
... but it doesn't mention how it escapes both the page name and the parameters
in ways that often make it impossible to use. It's unlikely that any links
expect that behaviour, but worth being aware of just in case.
Aside: InterWiki links make it easier to update links when URLs change.
For example, when [[DebianIRC:]] was changed from ircs://irc.debian.org/ to
ircs://irc.oftc.net/, all InterWiki links were updated automatically.
## DebianBug links
https://wiki.debian.org/htdocs/bugstatus.js seems to handle [[DebianBug:]],
[[https://bugs.debian.org/]], and apparently launchpad as well.
The obvious MediaWiki equivalent is a gadget[2].
An alternative would be to have a bot create a page like DebianBug/NNN/status
for every bug, then have the template for {{InterWiki|DebianBug|12345}}
look something like:
{{#ifeq: {{{1}}}
| DebianBug
| {{#ifexist: DebianBug/{{{2}}}/status
| <span class="{{DebianBug/{{{2}}}/status}}">[[DebianBug:{{{2}}}]]</span>
| [[DebianBug:{{{2}}}]]
}}
}}
That would require maintaining a bot, and would be harder to do for
Launchpad, but would avoid rendering the page with JavaScript.
Another alternative would be to have a bot populate a Cargo table,
then have the template check the Cargo table. That strikes me as
more flexible (e.g. package pages could list bugs for that package),
but Taavi has previously mentioned Cargo's security track record
as a reason not to deploy it. IMHO, this would be worth considering
if and only if we go for a Cargo-like extension for some other reason.
# Emoticons
There seems to be an emoticon extension[3], but I've never used it.
So we could hedge our bets with a template solution like {{Emoticon|:)}}
that just rendered the text unchanged, but could be updated to use logic
similar to {{InterWiki}} if we had to uninstall the extension in future.
# Macros
Macros in HelpOnMacros will probably need to be discussed separately,
but for purposes of this thread here are two arguments to indicate the
complexity of the problem:
The MediaWiki equivalent of <<TableOfContents([maxdepth])>> seems to be
<div class="toclevel-[maxdepth]">__TOC__</div>[4], but the MediaWiki
convention is to decide automatically whether pages get a TOC, and what
depth it should have. A literal translation would therefore add __NOTOC__
to existing pages that don't have a <<TableOfContents([maxdepth])>>,
whereas a more idiomatic solution would remove <<TableOfContents>> in
most cases and accept slightly different results.
<<StatsChart(type)>> only seems to be used on some MoinMoin internal pages
(e.g. EventStats/UserAgents). It might be better just not to convert
those pages at all.
The above are very debatable arguments, and probably be better handled
in their own thread :)
## Debian Macros
<<MessageId(foo-1234@example.com)>> / <<mid(foo-1234@example.com)>>
These seem to be InterWiki links to https://lists.debian.org/msgid-search/<arg>
<<Debian{Codename,CodenameLink,Date,Version}(suite)>>
For example, Template:DebianCodename might look something like:
{{#switch: {{{1}}}
| testing = trixie
| stable = bookworm
| oldstable = bullseye
| default (error: no such codename)
}}
# HelpOnParsers
I've only ever seen this used for highlighting ({{{#!highlight foo}}}),
where the equivalent is the SyntaxHighlight extension[5]. Personally,
I set `numbers=disable` in all pages I edit, because moin's line numbers
break copy/pasting. MediaWiki lacks that bug, so there's an argument
for removing (or at least manually reviewing) `numbers=disable` during
conversion.
Rather than search for other parsers with the site search functionality,
could somebody do `grep {{{#! | sort -u` on the moin database?
# HelpOnAdmonitions
The MediaWiki equivalent is Template:Hint[6]. Importing these will probably
spiral into importing most or all of the MW templates, which will be a big
ugly job, but will make it easier for newbies to come here from Wikipedia.
I'd argue for grasping this nettle earlier rather than later.
[1] https://www.mediawiki.org/wiki/Manual:Interwiki
[2] https://www.mediawiki.org/wiki/Extension:Gadgets
[3] https://www.mediawiki.org/wiki/Extension:Emoticons
[4] https://www.mediawiki.org/wiki/Manual:Table_of_contents#Depth
[5] https://www.mediawiki.org/wiki/Extension:SyntaxHighlight
[6] https://www.mediawiki.org/wiki/Template:Hint
Reply to: