WikiDocs Conversion: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
(added redirect (Imported from MoinMoin))
(Added more stuff (no end in sight, yet) (Imported from MoinMoin))
Line 13: Line 13:


==Display Status of Transclusion (Wiki or WikiDocs Content)==
==Correct URLs==


''This is already partially implemented.''
There are a couple of URLs that will not work as expectet, when the content is transcluded through the [[Wiki Web Service|WikiWebService]]:
* 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>.


The [[Wiki Web Service|WikiWebService]] must display Transcluded pages differently depending on whether they have been moderated or not:
==Remove the Link-to-Outside Icon==


''This only needs to be done on [[WikiDocs Page|WikiDocsPage]]<code><nowiki></nowiki></code>s, wiki pages do not need this.''
* [[WikiDocs Page|WikiDocsPage]]<code><nowiki></nowiki></code>s
* [[Image:Checkmark.png]] Must be displayed within a <code><nowiki><div class="WikiDocsContent"></nowiki></code>.
* Currently it prepends this division with the words "Wiki Documentation". I do not think this is necessary. [[WikiDocs Page|WikiDocsPage]]<code><nowiki></nowiki></code>s should perhaps have a sentence like "This [[WikiDocs Page|WikiDocsPage]] is moderated by [[User:DonRedman|DonRedman]] and based on revision #5 of the [[Wiki Page|WikiPage]] [[Picard Tagger|PicardTagger]]" at the bottom. However, the part "This [[WikiDocs Page|WikiDocsPage]] is moderated by [[User:DonRedman|DonRedman]]" is the important part and this should be ''written on the [[Wiki Page|WikiPage]]''. The rest is not really important.


* [[Wiki Page|WikiPage]]<code><nowiki></nowiki></code>s
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.
* [[Image:Checkmark.png]] Must be displayed within a <code><nowiki><div class="WikiContent"></nowiki></code>. This division is rendered as the dotted box (<code><nowiki>border: black dotted 2px</nowiki></code>) which is the "symbol" of wikiness in [[MusicBrainz]].
* Currently it prepends this with "Wiki Page". This text should be more informative. It should be something like "This page has been copied from our Wiki without moderation. The content is probably correct and informative, but no one has reviewed it. Read with some consideration." (hmm, this could be reworded...do you use "consideration" in this context?)


Note that the css is not working correctly, right now. It displays <code><nowiki><h1></nowiki></code> in the style that is used for <code><nowiki><h2></nowiki></code> in the wiki and so forth.
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==
==Differntiate Between Links to WikiDocs and Links to Wiki==
Line 53: Line 50:
| 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
|}
|}

==Correct URLs==

There are a couple of URLs that will not work as expectet, when the content is transcluded through the [[Wiki Web Service|WikiWebService]]:
* 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==

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

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.

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.

==Use Adequate User Settings with MoinMoin==

The [[Wiki Web Service|WikiWebService]] will have to persuade [[Moin Moin|MoinMoin]] to serve it pages according to specific settings:
* Don't show a question mark in front of links to unexistant pages.
* Separate [[Wiki Word|WikiWord]]<code><nowiki></nowiki></code>s with spaces.

The obvious solution is to log in as a special user and save the settings as that user's [[User Preferences|UserPreferences]]. I know that Robert hates this. A special Theme (which can be called with the MoinMion:ThemesMacro) might be an alternative way of doing this (but to be honest I do not know on which level of Moin these settings are set and applied, so this might not work at all).


==Deal with #REDIRECTs==
==Deal with #REDIRECTs==
Line 67: Line 91:
So, the minimum requirement is that the converter should display redirects for ''wiki pages''.
So, the minimum requirement is that the converter should display redirects for ''wiki pages''.


==Remove Unofficial Content==
==(Optional) 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 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>

Revision as of 16:41, 1 November 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.

The current purpose of this page is to list all coversions that the WikiWebService should do. RobertKaye already implemented a part of this as a mason component that works on the html which it pulls from e.g. http://wiki.musicbrainz.org/WikiHome?action=print&rev=9. This starts, however, to become pretty complex. Therefore we should first list all required conversions, and then see how this could be implemented.

An alternative to the mason component would be to patch a MoinMoin module (e.g. a Theme or a Formatter). Not that MoinMoin has a ThemesMacro. If you install that you can call a theme via the url like this http://moinmoin.wikiwikiweb.de/ThemeMarket?action=theme&theme=matrix. So if the WikiDocsConversion starts to become complex, it might be a solution to do all this stuff with a theme, instead of with Perl meddling with html.

The remainder of this page lists all conversin tasks, one section each:


Display Status of Transclusion (Wiki or WikiDocs Content)

This is already partially implemented.

The WikiWebService must display Transcluded pages differently depending on whether they have been moderated or not:

  • WikiDocsPages
  • Checkmark.png Must be displayed within a <div class="WikiDocsContent">.
  • Currently it prepends this division with the words "Wiki Documentation". I do not think this is necessary. WikiDocsPages should perhaps have a sentence like "This WikiDocsPage is moderated by DonRedman and based on revision #5 of the WikiPage PicardTagger" at the bottom. However, the part "This WikiDocsPage is moderated by DonRedman" is the important part and this should be written on the WikiPage. The rest is not really important.
  • WikiPages
  • Checkmark.png Must be displayed within a <div class="WikiContent">. This division is rendered as the dotted box (border: black dotted 2px) which is the "symbol" of wikiness in MusicBrainz.
  • Currently it prepends this with "Wiki Page". This text should be more informative. It should be something like "This page has been copied from our Wiki without moderation. The content is probably correct and informative, but no one has reviewed it. Read with some consideration." (hmm, this could be reworded...do you use "consideration" in this context?)

Note that the css is not working correctly, right now. It displays <h1> in the style that is used for <h2> in the wiki and so forth.

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

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.

Use Adequate User Settings with MoinMoin

The WikiWebService will have to persuade MoinMoin to serve it pages according to specific settings:

  • Don't show a question mark in front of links to unexistant pages.
  • Separate WikiWords with spaces.

The obvious solution is to log in as a special user and save the settings as that user's UserPreferences. I know that Robert hates this. A special Theme (which can be called with the MoinMion:ThemesMacro) might be an alternative way of doing this (but to be honest I do not know on which level of Moin these settings are set and applied, so this might not work at all).

Deal with #REDIRECTs

Can the WikiWebService follow redirects? I do not know how such a redirect is done with MoinMoin. Whether and how the web service can figure out that a page is a redirect depends on the following:

  • Is a http redirect header sent?
  • Is an inline html meta redirect added (I suppose not)
  • Does the redirect happen within MoinMoin entrely?

I could not find much information on how redirect works in MoinMoin. The only page I found is MarkupSpecification.

If this gets complicated, we should simply keep redirects out of the set of WikiDocsPages. That should not be too hard. Or if we really have to use a redirect we could perhaps use #DEPRECTATED instead (explained on that same MarkupSpecification page).

So, the minimum requirement is that the converter should display redirects for wiki pages.

(Optional) 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