Difference between revisions of "WikiDocs Conversion"

From MusicBrainz Wiki
m
(Original content from 2006 and dealed with the MoinMoin conversion process.)
 
Line 1: Line 1:
=WikiDocs Conversion Process=
+
#REDIRECT [[WikiDocs]]
 
 
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.
 
 
 
'''Status:''' ''This page is up to date again.''
 
 
 
The current purpose of this page is to list all coversions that the [[Wiki Web Service|WikiWebService]] should do. [[User:RobertKaye|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 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 [[Moin Moin|MoinMoin]] module (e.g. a Theme or a Formatter). Not that [[Moin Moin|MoinMoin]] has a [[MoinMoin:ThemesMacro|ThemesMacro]]. If you install that you can call a theme via the url like this [http://moinmoin.wikiwikiweb.de/ThemeMarket?action=theme&theme=matrix 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:
 
 
 
 
 
 
==Display Status of Transclusion (Wiki or WikiDocs Content)==
 
 
 
The [[Wiki Web Service|WikiWebService]] must display Transcluded pages differently depending on whether they have been moderated or not:
 
* [[WikiDocs Page|WikiDocsPage]]s
 
** [[Image:Checkmark.png]] Must be displayed within a <code><nowiki><div class="WikiDocsContent"></nowiki></code>.
 
** (done/still to correct?) Currently it prepends this division with the words "Wiki Documentation". It should be a little more informative:
 
*** The converter should add the following sentence to the bottom (not the top):
 
<ul><li style="list-style-type:none">"This [[WikiDocs Page|WikiDocsPage]] is based on revision #5 of the [[Wiki Page|WikiPage]] [[Picard Tagger|PicardTagger]]"
 
***  [[Image:Checkmark.png]] Note that [[WikiDocs Page|WikiDocsPage]] should link to mb.org/doc/[[WikiDocs Page|WikiDocsPage]]!
 
***  [[Image:Checkmark.png]] It would be nice if "#5" Would link to [http://wiki.musicbrainz.org/PicardTagger?action=info http://wiki.musicbrainz.org/PicardTagger?action=info] 
 
</ul>
 
*** At the bottom of the [[WikiDocs Page|WikiDocsPage]] the responsible [[WikiDocs Moderator|WikiDocsModerator]] should add their name ''in the wiki markup''. (This cannot be done by the converter/transcluder). Maybe we can use a [[Back Link|BackLink]]ing scheme like [[Moderated By Don Redman|ModeratedByDonRedman]].
 
 
 
* [[Wiki Page|WikiPage]]s
 
** [[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]].
 
** [[Image:Checkmark.png]] The page is prepended with "This page has been copied from our Wiki. The content is ''not official'' but probably correct and informative.".
 
** [[Image:Checkmark.png]] IMO the words "''not official''" should be emphasized.
 
 
 
==Apply Proper Layout to HTML (tweaking and CSS)==
 
 
 
* [[Image:Checkmark.png]] Links need to be fixed up:
 
** Don't show a question mark in front of links to nonexistent pages.
 
** Separate [[Wiki Word|WikiWord]]s with spaces.
 
 
 
* [[Image:Checkmark.png]] 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. Headings should be like on the wiki.
 
* The css is buggy. I believe this is the standard css, since things are in a <code><nowiki><div lang="en" id="content"></nowiki></code>. On Opera lists are not properly indented. I belive the reason is that either margins or paddings are used wrongly. Maybe [[Christov Russel|ChristovRussel]] can take a look at this, I think he is quite good at CSSing. --[[User:DonRedman|DonRedman]]
 
 
 
==Differentiate Between Links to WikiDocs and Links to Wiki==
 
 
 
[[Image:Checkmark.png]] ''This only needs to be done on [[WikiDocs Page|WikiDocsPage]]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 table summarizes, what conversion should be done in which case:
 
{| border="1"
 
|-
 
|  Page in [[Moderated Revision Table|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 [[Wiki Web Service|WikiWebService]]:
 
* [[Image:Checkmark.png]] Links to attachments on wiki pages do not work. A correct URL would be <code><nowiki>[[Image:OfficialBio?action=AttachFile&do=get&target=DonRedmanPortrait.jpg]]</nowiki></code>. However, [[MoinMoin:HelpOnConfiguration/FileAttachments|HelpOnConfiguration/FileAttachments]] says that this link is subject to change, that there are security issues, and why they want to remove that option in the future.<br/> We should probably not use attachements on [[WikiDocs Page|WikiDocsPage]]s, so this does not need to be fixed.
 
* [[Image:Checkmark.png]] 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==
 
 
 
[[Image:Checkmark.png]] ''This only needs to be done on [[WikiDocs Page|WikiDocsPage]]s, wiki pages do not need this.''
 
 
 
Links to the outside world (of the wiki!) like [http://google.com 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 [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 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 <pre>.ExtraWikiIcon {display: none}
 
</pre>
 
 
 
The [[MoinMoin:InterWiki|InterWiki]] icon can be kept, IMO.
 
 
 
==Deal with #REDIRECTs==
 
 
 
[[Image:Checkmark.png]] Can the [[Wiki Web Service|WikiWebService]] follow redirects? I do not know how such a redirect is done with [[Moin Moin|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 [[Moin Moin|MoinMoin]] entrely?
 
 
 
Redirects now work correctly. The [[Content Rev|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==
 
 
 
[[Image:Checkmark.png]] 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: <pre> <official>
 
  bla bla
 
</official>
 
</pre>
 
 
 
The [[Moin Moin|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 [[Moin Moin|MoinMoin]]) and it will have ''meaning'' to them.
 
 
 
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.
 
 
 
[[Category:Development]]
 

Latest revision as of 04:24, 25 October 2009

Redirect to: