WikiDocs Conversion: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
((Imported from MoinMoin))
 
(major update (Imported from MoinMoin))
Line 1: Line 1:
=WikiDocs Conversion Process=
The [[Wiki Docs Converter|WikiDocsConverter]] is an component of the planned [[WikiDocs]]. It is a script that can be activated by [[WikiDocs Moderator|WikiDocsModerator]]s and which will copy a specified wiki page from the [[MusicBrainz Wiki|MusicBrainzWiki]] to the [[Moderated Wiki Mirror|ModeratedWikiMirror]].


The [[Wiki Web Service|WikiWebService]] is a part of the planned [[WikiDocs]] system This page should list all conversions that the web service has to do.
The wiki mirror will be implemented as a [[Shadow Wiki|ShadowWiki]]. Therefore both the [[MusicBrainz Wiki|MusicBrainzWiki]] and the wiki mirror will be [[Moin Moin|MoinMoin]] wikis. The script has not much to do:
* Take the wiki source from one [[MusicBrainz Wiki|MusicBrainzWiki]] page and make a new version of that same page on the [[Shadow Wiki|ShadowWiki]].
* Convert urls so that non-[[WikiDocs]] pages have an [[Inter Wiki Link|InterWikiLink]] (see below).
* convert relative urls to absolute urls or something like that ( This is something that is currently done by the [[Wiki Web Service|WikiWebService]]. I did not really understand exactly what it does and why it does it).
* Remove unofficial content.


''Status:''' ''This starts to be up to date again.''
==Convert to Inter Wiki Links==


When a user sees a [[WikiDocs]] page via the [[Wiki Web Service|WikiWebService]], those links that point to other [[WikiDocs]] pages should look like normal links, while those links that point to pages which only exist in the [[MusicBrainz Wiki|MusicBrainzWiki]] should look like links to somewhere else.


==Correct URLs==
One possible solution is to register the [[MusicBrainz Wiki|MusicBrainzWiki]] as a [[Sister Site|SisterSite]] to the [[Shadow Wiki|ShadowWiki]]. The links to non-[[WikiDocs]] pages would then be converted from, say <nowiki>[[Style Guideline|StyleGuideline]] to MBW:StyleGuideline</nowiki>.


There are a couple of URLs that will not work as expectet, when the content is transcluded through the [[Wiki Web Service|WikiWebService]]:
In this case, everytime someone copies a page to the [[Moderated Wiki Mirror|ModeratedWikiMirror]], the converter has to look over ''all'' pages in the [[Shadow Wiki|ShadowWiki]] and update the [[Inter Wiki Links|InterWikiLinks]]. All [[Wiki Name|WikiName]]s that are not in [http://wikidocs.musicbrainz.org/write/TitleIndex?action=titleindex http://wikidocs.musicbrainz.org/write/TitleIndex?action=titleindex] get the "MBW:" prefix.
* Links to attachements of wiki pages do not work. This needs to be fixed. A correct URL would be <code><nowiki>[[Image:OfficialBio?action=AttachFile&do=get&target=DonRedmanPortrait.jpg]]</nowiki></code>. However, the page on Attachements says that this link is subject to change. See [[MoinMoin:HelpOnConfiguration/FileAttachments|HelpOnConfiguration/FileAttachments]] for details, security issues, and why they want to remove tht option in the future.
* Currently the [[Wiki Web Service|WikiWebService]] already does some minor link rewriting to fix problems with relative links. It seems that the the wiki returns some links like <code><nowiki>http:/page.html</nowiki></code> (relative links). These are rewritten to absolute links like <code><nowiki>http://www.musicbrainz.org/page.html</nowiki></code>.


==Remove the Link-to-Outside Icon==
The inconvenient is that visitors would really be sent to the real [[MusicBrainz Wiki|MusicBrainzWiki]]. I do not know if [[Moin Moin|MoinMoin]] can be configured in a way that they are sent to an instance of the wiki that is uneditable and which has a theme that looks similar to the [[Main Site|MainSite]].


''This only needs to be done on [[WikiDocs Page|WikiDocsPage]]<code><nowiki></nowiki></code>s, wiki pages do not need this.''
Perhaps this can be overcome by using something else than [[Inter Wiki Links|InterWikiLinks]]. The converter could also change the links to ''external'' links to, say, <nowiki>[http://musicbrainz.org/wiki/StyleGuideline http://musicbrainz.org/wiki/StyleGuideline]</nowiki>, which would trigger another [[Wiki Web Service|WikiWebService]] located at /wiki/ which serves content from the [[MusicBrainz Wiki|MusicBrainzWiki]].


Liks to the outside world (of the wiki!) like [http://google.com this one] are rendered with a special icon in formt of the link. This icon signals that you will leave the wiki if you follow the link.
Also, pages that do not exist on the [[MusicBrainz Wiki|MusicBrainzWiki]] should not get links. So the converter will probably have to look at the [[Title Index|TitleIndex]] of both the [[MusicBrainz Wiki|MusicBrainzWiki]] and the [[Shadow Wiki|ShadowWiki]] to do the right thing. Problem: The [[Title Index|TitleIndex]] of the [[MusicBrainz Wiki|MusicBrainzWiki]] has to be read in real time. This is no job for the converter, is it?

The problem is that links to [http://www.musicbrainz.org/ http://www.musicbrainz.org/] are ''external'' to the wiki. Therefore all links to static [[MusicBrainz]] pages will have this icon. The transclusion mechanism must therefore remove this icon. In a perfect world, it would only remove it for pages on musicbrain.org. But I suppose that this is too difficult and IMO it is ok if it just removes the icon alltogether.

A ''very simple'' solution would be this: Can the Theme (or the Formatter?) add a css class to this icon? In this case it could simply be removed with a css line like <pre>.ExtraWikiIcon {display: none}
</pre>

The [[MoinMoin:InterWiki|InterWiki]] icon can be kept, IMO.

==Differntiate Between Links to WikiDocs and Links to Wiki==

''This only needs to be done on [[WikiDocs Page|WikiDocsPage]]<code><nowiki></nowiki></code>s, wiki pages do not need this.''

When a user sees a [[WikiDocs]] page via the [[Wiki Web Service|WikiWebService]], those links that point to other [[WikiDocs]] pages should look like normal links, while those links that point to pages which only exist in the [[MusicBrainz Wiki|MusicBrainzWiki]] should look like links to somewhere else.

A simple formatting can just render inter-[[WikiDocs]] links bold and [[WikiDocs]]-to-wiki links plain. A fancy formatting could prepend a wiki-icon to [[WikiDocs]]-to-wiki links.

The following tabel summarizes, what conversion should be done in which case:
{| border="1"
{| border="1"
|-
|-
| Page in [[Title Index|TitleIndex]] of [[MusicBrainz Wiki|MusicBrainzWiki]] || Page in [[Title Index|TitleIndex]] of [[Shadow Wiki|ShadowWiki]] || Action taken
| Page in [[Title Index|TitleIndex]] of [[MusicBrainz Wiki|MusicBrainzWiki]] || Page in [[Moderated Revision Table|ModeratedRevisionTable]] || Action taken
|-
|-
| Yes || Yes || [[Shadow Wiki|ShadowWiki]] points to itself
| Yes || Yes || Link is normal or bold
|-
|-
| Yes || No || Link should look different and point to [[Wiki Web Service|WikiWebService]] of [[MusicBrainz Wiki|MusicBrainzWiki]]
| Yes || No || Link is thin or has wiki icon
|-
|-
| No || Yes || Uh? Send a warning to admin. Someone has deleted an official page! Still, [[Shadow Wiki|ShadowWiki]] can point to itself
| No || Yes || [[Image:Alert.png]] Send a warning to admin. With [[Moin Moin|MoinMoin]] this means that someone has renamed the page, effectively moving the history to the new page name.
|-
|-
| No || No || [[Wiki Name|WikiName]] should not be presented as a link at all
| No || No || [[Wiki Name|WikiName]] should not be presented as a link at all
|}
|}

God, is this complicated. I will leave the implementation details to Robert.


==Remove Unofficial Content==
==Remove Unofficial Content==


I am not at all sure, whether we need this. There might be some good way around this, like using discussion pages. However, should the need arise, then we could add our own "official" tag to the [[MusicBrainz]] wiki in an XML-style: <pre> <official>
I am not 100% sure, we need this.
bla bla

</official>
We could add our own "official" tag to the [[MusicBrainz]] wiki: an XML-style: <pre><official>
</pre>
</pre>

<pre> bla bla
</pre>

<pre></official>
</pre>


The [[Moin Mion|MoinMion]] engine will of course ignore these tags. It will just display them. That is ok. Users will see the tags (when accessing the wiki via [[Moin Moin|MoinMoin]]) and it will have ''meaning'' to them.
The [[Moin Mion|MoinMion]] engine will of course ignore these tags. It will just display them. That is ok. Users will see the tags (when accessing the wiki via [[Moin Moin|MoinMoin]]) and it will have ''meaning'' to them.


When you feed a page to the converter, it will look for this tag, and ''if'' it finds such tags, it will remove everything outside the tags and then the tags tehmselves in the [[Shadow Wiki|ShadowWiki]] version of that page.
When the [[Wiki Web Service|WikiWebService]] gets a page as a [[WikiDocs]] page, it will look for these tags, and ''if'' it finds such tags (in the text not in the html code!), it will remove everything outside the tags and then the tags tehmselves in the [[Shadow Wiki|ShadowWiki]] version of that page. This way the source of a wiki page can contain stuff that will not be visible when transcluded.

This way the source of a wiki page can contain stuff that will not be visible on the [[Main Site|MainSite]].


----initial author: [[User:DonRedman|DonRedman]]
----initial author: [[User:DonRedman|DonRedman]]

Revision as of 14:45, 29 October 2005

WikiDocs Conversion Process

The WikiWebService is a part of the planned WikiDocs system This page should list all conversions that the web service has to do.

Status:' This starts to be up to date again.


Correct URLs

There are a couple of URLs that will not work as expectet, when the content is transcluded through the WikiWebService:

  • Links to attachements of wiki pages do not work. This needs to be fixed. A correct URL would be [[Image:OfficialBio?action=AttachFile&do=get&target=DonRedmanPortrait.jpg]]. However, the page on Attachements says that this link is subject to change. See HelpOnConfiguration/FileAttachments for details, security issues, and why they want to remove tht option in the future.
  • Currently the WikiWebService already does some minor link rewriting to fix problems with relative links. It seems that the the wiki returns some links like http:/page.html (relative links). These are rewritten to absolute links like http://www.musicbrainz.org/page.html.

Remove the Link-to-Outside Icon

This only needs to be done on WikiDocsPages, wiki pages do not need this.

Liks to the outside world (of the wiki!) like this one are rendered with a special icon in formt of the link. This icon signals that you will leave the wiki if you follow the link.

The problem is that links to http://www.musicbrainz.org/ are external to the wiki. Therefore all links to static MusicBrainz pages will have this icon. The transclusion mechanism must therefore remove this icon. In a perfect world, it would only remove it for pages on musicbrain.org. But I suppose that this is too difficult and IMO it is ok if it just removes the icon alltogether.

A very simple solution would be this: Can the Theme (or the Formatter?) add a css class to this icon? In this case it could simply be removed with a css line like

.ExtraWikiIcon {display: none}

The InterWiki icon can be kept, IMO.

Differntiate Between Links to WikiDocs and Links to Wiki

This only needs to be done on WikiDocsPages, wiki pages do not need this.

When a user sees a WikiDocs page via the WikiWebService, those links that point to other WikiDocs pages should look like normal links, while those links that point to pages which only exist in the MusicBrainzWiki should look like links to somewhere else.

A simple formatting can just render inter-WikiDocs links bold and WikiDocs-to-wiki links plain. A fancy formatting could prepend a wiki-icon to WikiDocs-to-wiki links.

The following tabel summarizes, what conversion should be done in which case:

Page in TitleIndex of MusicBrainzWiki Page in ModeratedRevisionTable Action taken
Yes Yes Link is normal or bold
Yes No Link is thin or has wiki icon
No Yes Alert.png Send a warning to admin. With MoinMoin this means that someone has renamed the page, effectively moving the history to the new page name.
No No WikiName should not be presented as a link at all

Remove Unofficial Content

I am not at all sure, whether we need this. There might be some good way around this, like using discussion pages. However, should the need arise, then we could add our own "official" tag to the MusicBrainz wiki in an XML-style:

 <official>
   bla bla
 </official>

The MoinMion engine will of course ignore these tags. It will just display them. That is ok. Users will see the tags (when accessing the wiki via MoinMoin) and it will have meaning to them.

When the WikiWebService gets a page as a WikiDocs page, it will look for these tags, and if it finds such tags (in the text not in the html code!), it will remove everything outside the tags and then the tags tehmselves in the ShadowWiki version of that page. This way the source of a wiki page can contain stuff that will not be visible when transcluded.


initial author: DonRedman