WikiDocsConversion

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 page is 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. [WWW] 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 [MoinMoin]ThemesMacro. If you install that you can call a theme via the url like this [WWW] 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 conversion tasks, one section each:

  1. WikiDocs Conversion Process
    1. Display Status of Transclusion (Wiki or WikiDocs Content)
    2. Apply Proper Layout to HTML (tweaking and CSS)
    3. Differentiate Between Links to WikiDocs and Links to Wiki
    4. Correct URLs
    5. Remove the Link-to-Outside Icon
    6. Deal with #REDIRECTs
    7. Intelligible Error Message if Page Does Not Exist
    8. (Optional) Remove Unofficial Content
    9. Discussion

Display Status of Transclusion (Wiki or WikiDocs Content)

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

Apply Proper Layout to HTML (tweaking and CSS)

Differentiate 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 table summarizes, what conversion should be done in which case:

Page in ModeratedRevisionTable

Action taken

Yes

Link is normal or bold

No

Link is thin or has wiki icon

Correct URLs

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

Remove the Link-to-Outside Icon

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

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

The problem is that links to [WWW] 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 musicbrainz.org. But I suppose that this is too difficult and IMO it is ok if it just removes the icon in all cases.

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 [MoinMoin]InterWiki icon can be kept, IMO.

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:

Redirects now work correctly. The ContentRev plugin detects when it was asked for a page that has been redirected -- in that case it sends a 302 Found message back to the transcluder and the transcluder starts the transclusion process over again. The end effect is that the end user does not know that a redirect has happened. Also note that the URL does not get re-written to reflect the changed location.

Intelligible Error Message if Page Does Not Exist

(./) Currently, if a requested wiki page does not exist, the transclusion script generates a blank page. It should generate an intelligible error message instead.

(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 MoinMoin 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.

Discussion

I think that it would be useful to have the Discussion section automatically removed, regardless of the prescence or abscence of any additional tags. --MartinRudat


CategoryDevelopment

initial author: DonRedman

last edited 2007-04-09 12:02:05 by murdos

MusicBrainz web site  *  Support / Contact