mediawiki-mark-up-issues: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
([fr: removed redirect + translation of mediawiki])
m (Reverted edits by ChristopheDucamp (Talk) to last version by RyanKing)
 
Line 1: Line 1:
=MediaWiki mark-up issues=
{{TOC-right}}


<entry-title>MediaWiki</entry-title>
Issues with adding microformat mark-up to sites using [http://www.mediawiki.org/ MediaWiki] (such as this wiki, and [http://wikipedia.org Wikipedia]).


{{stub-fr}}
If you know of a solution, or work-around, please post it!


'''[http://mediawiki.org/ MediaWiki]''' est un [[cms-fr|gestionnaire de contenus]] open source.
==Author==
[[User:AndyMabbett|Andy Mabbett]]


== microformats support ==
==Contributor(s)==
MediaWiki a quelque support microformats intégrés
[[User:JeffMcNeill|Jeff McNeill]]
* [http://www.mediawiki.org/wiki/Microformats MediaWiki Microformats] support


Tout comme des extensions pour des éléments additionnels qui aident au support des microformats :
==URLs==
* [http://www.mediawiki.org/wiki/Extension:AllowAnchorTags Extension:AllowAnchorTags] Ajoute des balises <code>&lt;anchor>&lt;/anchor></code> et les parse en balises <code>&lt;a href=>&lt;/a></code>.
*Wiki mark-up such as <code><nowiki>[http://example.com sample text]</nowiki></code> (which displays as [http://example.com sample text]) cannot have a class="url" added to the output "<code>A</code>" element.
* [http://www.mediawiki.org/wiki/Extension:EnableAbbrTags Extension:EnableAbbrTags] Ajoute le support pour les balises  <code>&lt;xabbr>&lt;/xabbr></code> et les parse en balises <code>&lt;abbr>&lt;/abbr></code>.
**Workaround (if display of the URL is acceptable): use <code><nowiki><span class="url">http://example.com</span></nowiki></code> (which displays as <span class="url">http://example.com</span>)
**Workaround (if display of the URL is not acceptable): ???
***Why not just use <code><nowiki><span class="url">[http://example.com sample text]</span></nowiki></code>? --[[User:TiszaGergo|Tgr]]<sup>[[User talk:TiszaGergo|talk]] / [[wikipedia:User:Tgr|home]]</sup> 06:16, 9 Aug 2007 (PDT)
****Returns a value of "sample text" [[User:AndyMabbett|Andy Mabbett]] 02:12, 10 Aug 2007 (PDT)


== en progrès ==
* The [http://www.mediawiki.org/wiki/Extension:ExtendAnchorTags ExtendAnchorTags] extension provides a work around using <xa></xa> tags, e.g.
=== Marquage des articles avec [[hatom-fr|hAtom]] ===
<xa class="fn org" href="http://microformats.org/">microformats</xa>
will produce
<a fn class="fn org" href="http://microformats.org/>microformats</a> --[[User:JeffMcNeill|jeffmcneill]] 17:22, 20 Oct 2007 (PDT)


Le wiki microformats —qui tourne avec MediaWiki avec une skin personnalisée—utilise les microformats dans le marquage de la page. Nommément, chaque page wiki (article) est marquée en utilisant hAtom, fournissant une structure commune pour les titres, auteurs, contenus et ainsi de suite.
==Rel==
*Similarly, MediaWiki does not appear to support the use of the <code>rel</code> attribute on internal or external links.
** See [http://www.mediawiki.org/wiki/Extension:ExtendAnchorTags ExtendAnchorTags] extension --[[User:JeffMcNeill|jeffmcneill]] 17:22, 20 Oct 2007 (PDT)


===Fournir la capacité d'insérer des microformats dans les pages===
==Tables==
*In the following code snippet (from an "[http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Infoboxes infobox]" table with an included [[hCard]]):


Ce qui veut dire, marquer un événement, une personne, une entreprise et ainsi de suite comme faisant partie d'un article, est super-lourd. C'est quelque chose que personne n'a résolu à cette heure, et requiert une mise à jour du mécanisme de marquage pour permettre aux personnes d'ajouter des attributs  `class`, `rel` et `rev. Quelques attributs ont évolué vers cela : L'extension Link Attributes pour MediaWiki augmente la syntaxe lien pour permettre class, rel et rev. http://www.mediawiki.org/wiki/Extension:Link_Attributes
<code>
<pre>
<nowiki>
{| class="infobox vcard"
| class="fn org" | '''{{{name}}}'''
|-
{{#if: {{{address|}}} |
! Address
{{!}} <span class="street-address">{{{address}}}}}</span>
|-
{{#if:{{{city|}}} |
! City
{{!}} <span class="locality">{{{city|}}}}}</span>
|-
{{#if:{{{country|}}} |
! Country
{{!}} <span class="country-name">{{{country|}}}}}</span>
|-
{{#if:{{{latitude|}}} |
!
{{!}} <{{Coord|{{{latitude}}}|{{{longitude}}}|display=title}} }}
|}
</nowiki>
</pre>
</code>


J'ai aussi travaillé sur une extension possible MarkDown pour le même objectif, qui pourrait ressembler à quelque chose comme ceci, utilisant les parenthèses pour les attributs :
:there is nowhere to hang the required <code>class="adr"</code>, such that it wraps the three relevant table rows, and no others.


<source lang=text>[Ben Ward](http://benward.me){fn url, rel=me}</source>
*you can give a row a class (or any other valid HTML attribute) with <code><nowiki>{{!}} class="adr" {{!}} <span...</nowiki></code> --[[User:TiszaGergo|Tgr]]<sup>[[User talk:TiszaGergo|talk]] / [[wikipedia:User:Tgr|home]]</sup> 06:16, 9 Aug 2007 (PDT)
**The need is not to apply a class to a single row, but (as stated) to apply it to (in this example) "the three relevant table rows, and no others". [[User:AndyMabbett|Andy Mabbett]] 02:14, 10 Aug 2007 (PDT)
***It seems this is a challenge with HTML tables and not necessarily MediaWiki? Please advise --[[User:JeffMcNeill|jeffmcneill]] 17:22, 20 Oct 2007 (PDT)
****Partly; but in HTML you can hang an intermediate class on <nowiki><tbody></nowiki>. [[User:AndyMabbett|Andy Mabbett]] 15:42, 19 Jan 2008 (PST)


Pour produire :  
==Abbr==
*MediaWiki supports the use of the <code>abbr</code> element, but this is disabled by some implementations (e.g. Wikipedia)
**See [[title-trigger]] for a proposed alternative to the [[abbr-design-pattern]], which would work on Wikipedia.
*** A mediawiki extension [http://www.mediawiki.org/wiki/Extension:EnableAbbrTags EnableAbbrTags] can support abbr by using a new xabbr command


<source lang=html4strict><a class="fn url" rel="me"></source>
==Dtend==


[[twiki|TWiki]] pourrait en fait évoluer de manière similaire :  
*The work-around for date-time pattern on Wikipedia (for example, birthdays in hCard) has been to use templates to output something like:  


<source lang=text>[[http://benward.me][Ben Ward][fn url, rel=me]]</source>
<pre>
<nowiki>
24 February 1993 (<span class="bday" style="display:none">1993-02-24</span>)
</nowiki>
</pre>


Cela serait aussi nécessaire d'autoriser l'ajout d'attributs class en blocs arbitraires  (p, div, spans etc.)
which degrades gracefully if CSS is not available. It is not acceptable to do so, to show the date advanced by one day for end-dates in hCalendar.


== voir aussi ==
**See this [http://microformats.org/discuss/mail/microformats-discuss/2007-August/010449.html proposal to resolve exclusive end-date issue], for a proposal which would allow ''inclusive'' end dates to be marked up.
* [http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Microformats Wikipedia:WikiProject Microformats]
 
* [[mediawiki-customization-fr]]
==XMDP==
* [[mediawiki-mark-up-issues-fr]]
*As with many CMSs, there is no facility for an editor to add an [[XMDP]] URI to (or in any other way to alter) the <code>head</code> element.
* [[cms-fr|CMS]]
 
* [[hcard-fr|hCard]]
** Extensions can do this, working on it... --[[User:JeffMcNeill|jeffmcneill]] 17:22, 20 Oct 2007 (PDT)
 
==Address==
 
Address elements cannot be added to page content.
 
:<pre><nowiki><address class="vcard">The <span class="fn org">Microformat community</span></address></nowiki></pre>
 
displays as:
 
:<address class="vcard">The <span class="fn">Microformat community</span></address>
 
*Not sure how this is a problem, which microformat uses this format? Markup within divs such as <pre><nowiki><div class="adr"></div></nowiki></pre> work fine. --[[User:JeffMcNeill|jeffmcneill]] 01:14, 21 Oct 2007 (PDT)
 
** [[hatom|hAtom]] uses <nowiki><address></nowiki>. [[User:AndyMabbett|Andy Mabbett]] 15:42, 19 Jan 2008 (PST)
 
=Mediawiki extension development=
*Are there any generic xml parsers/other extensions under development to provide support for some (most?) of the microformat needs? Is [http://ontoworld.org/wiki/Semantic_MediaWiki semantic mediawiki] a possible candidate for microformat support?
** It appears that semantic mediawiki is trying to do something different, namely OWL compliance. Based on the mediawiki [http://meta.wikimedia.org/wiki/Semantic_MediaWiki description of the semantic mediawiki project], ''hacks'' are to some extent discouraged (which to my mind is the orientation of Microformats). --[[User:JeffMcNeill|jeffmcneill]] 13:41, 18 Oct 2007 (PDT)
 
* Am working out the extensions needed to address this. --[[User:JeffMcNeill|jeffmcneill]] 17:22, 20 Oct 2007 (PDT)

Latest revision as of 20:57, 21 September 2012

MediaWiki mark-up issues

Issues with adding microformat mark-up to sites using MediaWiki (such as this wiki, and Wikipedia).

If you know of a solution, or work-around, please post it!

Author

Andy Mabbett

Contributor(s)

Jeff McNeill

URLs

  • Wiki mark-up such as [http://example.com sample text] (which displays as sample text) cannot have a class="url" added to the output "A" element.
    • Workaround (if display of the URL is acceptable): use <span class="url">http://example.com</span> (which displays as http://example.com)
    • Workaround (if display of the URL is not acceptable): ???
      • Why not just use <span class="url">[http://example.com sample text]</span>? --Tgrtalk / home 06:16, 9 Aug 2007 (PDT)
        • Returns a value of "sample text" Andy Mabbett 02:12, 10 Aug 2007 (PDT)
  • The ExtendAnchorTags extension provides a work around using <xa></xa> tags, e.g.
<xa class="fn org" href="http://microformats.org/">microformats</xa>

will produce

<a fn class="fn org" href="http://microformats.org/>microformats</a> --jeffmcneill 17:22, 20 Oct 2007 (PDT)

Rel

  • Similarly, MediaWiki does not appear to support the use of the rel attribute on internal or external links.

Tables

  • In the following code snippet (from an "infobox" table with an included hCard):


{| class="infobox vcard" 
| class="fn org" | '''{{{name}}}'''
|-
{{#if: {{{address|}}} |
! Address
{{!}} <span class="street-address">{{{address}}}}}</span>
|-
{{#if:{{{city|}}} |
! City
{{!}} <span class="locality">{{{city|}}}}}</span>
|-
{{#if:{{{country|}}} |
! Country
{{!}} <span class="country-name">{{{country|}}}}}</span>
|-
{{#if:{{{latitude|}}} |
!
{{!}} <{{Coord|{{{latitude}}}|{{{longitude}}}|display=title}} }}
|}

there is nowhere to hang the required class="adr", such that it wraps the three relevant table rows, and no others.
  • you can give a row a class (or any other valid HTML attribute) with {{!}} class="adr" {{!}} <span... --Tgrtalk / home 06:16, 9 Aug 2007 (PDT)
    • The need is not to apply a class to a single row, but (as stated) to apply it to (in this example) "the three relevant table rows, and no others". Andy Mabbett 02:14, 10 Aug 2007 (PDT)
      • It seems this is a challenge with HTML tables and not necessarily MediaWiki? Please advise --jeffmcneill 17:22, 20 Oct 2007 (PDT)
        • Partly; but in HTML you can hang an intermediate class on <tbody>. Andy Mabbett 15:42, 19 Jan 2008 (PST)

Abbr

  • MediaWiki supports the use of the abbr element, but this is disabled by some implementations (e.g. Wikipedia)

Dtend

  • The work-around for date-time pattern on Wikipedia (for example, birthdays in hCard) has been to use templates to output something like:

24 February 1993 (<span class="bday" style="display:none">1993-02-24</span>)

which degrades gracefully if CSS is not available. It is not acceptable to do so, to show the date advanced by one day for end-dates in hCalendar.

XMDP

  • As with many CMSs, there is no facility for an editor to add an XMDP URI to (or in any other way to alter) the head element.
    • Extensions can do this, working on it... --jeffmcneill 17:22, 20 Oct 2007 (PDT)

Address

Address elements cannot be added to page content.

<address class="vcard">The <span class="fn org">Microformat community</span></address>

displays as:

<address class="vcard">The Microformat community</address>
  • Not sure how this is a problem, which microformat uses this format? Markup within divs such as
    <div class="adr"></div>
    work fine. --jeffmcneill 01:14, 21 Oct 2007 (PDT)

Mediawiki extension development

  • Are there any generic xml parsers/other extensions under development to provide support for some (most?) of the microformat needs? Is semantic mediawiki a possible candidate for microformat support?
    • It appears that semantic mediawiki is trying to do something different, namely OWL compliance. Based on the mediawiki description of the semantic mediawiki project, hacks are to some extent discouraged (which to my mind is the orientation of Microformats). --jeffmcneill 13:41, 18 Oct 2007 (PDT)
  • Am working out the extensions needed to address this. --jeffmcneill 17:22, 20 Oct 2007 (PDT)