Jani Patokallio Hacking MediaWiki  http://www.mediawiki.org/
MediaWiki/Wikimedia Wiki structure Wiki customisation Outline
Open-source (GPL) wiki engine  software (uses LAMP) MediaWiki Wikimedia MediaWiki US foundation that runs a bunch of Wiki sites (Wikipedia etc.)
Pages “ Page A” “ Page B” Tied together by... Links: A-> B Wiki structure
Special:WhatLinksHere (B-> A) Special:RecentChangesLinked (B-> C) Special:MostLinked Special:WantedPages Links Help:Links
Links Subpages Wiki structure
Automated breadcrumbs “up” A / B / C into A ←   B ←   C Subpages Help:Subpages
Links Subpages  Namespaces Wiki structure
“ Front” page + talk page Main, Project, Help,  add more... Template Category Special* Image, Media* MediaWiki* (* = pseudo namespace) Namespaces Help:Namespaces
Special:RecentChanges Special:SpecialPages Special pages Help:Special pages
Categories Help:Categories Group together pages
 
Links Subpages Namespaces  Categories Templates Wiki structure
Page transclusion: {{foo}} <noinclude>, <includeonly>,  {{subst:foo}} Parameters Templates Help:Templates
 
 
Special:ExpandTemplates
Special:ExpandTemplates
Look like {{CAPS TEMPLATES}} Especially used in templates - context. Time, revision related Stats! {{NUMBEROFARTICLES}} {{NUMBEROFEDITS}} {{NUMBEROFUSERS}} {{PAGESINCATEGORY:Foo}} Magic words Help:Magic words
Special:ListGroupRights “ Anonymous”/IP editor User Admin (Sysop) Bureaucrat Bot User access levels Manual:User rights
In the box – configuration MediaWiki: namespace CSS Outside the box – programming Gadgets Extensions Bots (API) Wiki customisation
“ System [interface] messages” Edit MediaWiki: pages to overrride defaults (sysops only) Search on  Special:Allmessages  to  find the right message/page MediaWiki namespace Manual:System message
 
Users can customize their own view! MediaWiki:Common.css MediaWiki:Common.js Monobook skin:  (same for others) MediaWiki:Monobook.css MediaWiki:Monobook.js Look & feel
Massively simplify user JS/CSS sharing: no more copying user subpages MediaWiki:Gadgets-definition -> New Preferences tab JS/CSS Gadgets Extension:Gadgets
MediaWiki:Gadgets-definition MediaWiki:Gadget-section-browsing-gadgets MediaWiki:Gadget-Navigation popups List of file names MediaWiki:Gadget-foo.js/css
Special:Preferences -> Gadgets
Make your edit box less scary: Gadget rec: wikEd http://enwp.org/WP:WIKED
The way to add random PHP code to extend MediaWiki's functionality ~1500 already available Quality varies widely Stick to those already live   on Wikimedia projects... Extensions Manual:Extensions
Adds  Editor, Reviewer  user classes Page revisions must be approved   before they go live to public Comments and quality flags for   pages Being rolled out on   Wikipedia now FlaggedRevs Extension:FlaggedRevs
When categories aren't enough... Semantic tags in content   [[name::Melbourne]] [[place::city]]   [[pop::3609734]] SQL-type queries across content   {{#ask: [[place::city]]   [[pop::>1000000]] | ?name }} Semantic Mediawiki semanticmediawiki.org
A “bot” is really just a script/program that connects to MediaWiki Can do anything than a human can Automatic running -> “bot” Special flag can hide bot edits Older bots used screen scraping pymediawiki framework  Bots  Help:Bots
HTTP-based interface for (almost) all MediaWiki operations Flexible, tested and doesn't break every time the Wiki skin changes Wide range of language libraries Ruby support pretty  poor though...   MediaWiki API  mediawiki.org/wiki/API
Query (XML) Parse (= render as HTML) Edit, delete, move Bulk import, export (again XML) API operations mediawiki.org/wiki/API
http://mediawiki.org  is half-decent now Still lots of info on  http://meta.wikimedia.org/ IRC is popular:  irc://irc.freenode.net/mediawiki MLs:  mediawiki-l Forum:  http://mwusers.com/  (unofficial) Support
Questions? Jani Patokallio <jani@contentshare.sg> Original slides by Brianna Laugher <brianna@modernthings.org> These slides are dual-licensed GFDL1.2+,  CC-BY-SA-3.0.  Screenshots are GFDL/GPL, WMF logo is all rights reserved,  MediaWiki logo is public domain.  Thank you!

Hacking Mediawiki

  • 1.
    Jani Patokallio HackingMediaWiki http://www.mediawiki.org/
  • 2.
    MediaWiki/Wikimedia Wiki structureWiki customisation Outline
  • 3.
    Open-source (GPL) wikiengine software (uses LAMP) MediaWiki Wikimedia MediaWiki US foundation that runs a bunch of Wiki sites (Wikipedia etc.)
  • 4.
    Pages “ PageA” “ Page B” Tied together by... Links: A-> B Wiki structure
  • 5.
    Special:WhatLinksHere (B-> A)Special:RecentChangesLinked (B-> C) Special:MostLinked Special:WantedPages Links Help:Links
  • 6.
  • 7.
    Automated breadcrumbs “up”A / B / C into A ← B ← C Subpages Help:Subpages
  • 8.
    Links Subpages Namespaces Wiki structure
  • 9.
    “ Front” page+ talk page Main, Project, Help, add more... Template Category Special* Image, Media* MediaWiki* (* = pseudo namespace) Namespaces Help:Namespaces
  • 10.
  • 11.
  • 12.
  • 13.
    Links Subpages Namespaces Categories Templates Wiki structure
  • 14.
    Page transclusion: {{foo}}<noinclude>, <includeonly>, {{subst:foo}} Parameters Templates Help:Templates
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
    Look like {{CAPSTEMPLATES}} Especially used in templates - context. Time, revision related Stats! {{NUMBEROFARTICLES}} {{NUMBEROFEDITS}} {{NUMBEROFUSERS}} {{PAGESINCATEGORY:Foo}} Magic words Help:Magic words
  • 20.
    Special:ListGroupRights “ Anonymous”/IPeditor User Admin (Sysop) Bureaucrat Bot User access levels Manual:User rights
  • 21.
    In the box– configuration MediaWiki: namespace CSS Outside the box – programming Gadgets Extensions Bots (API) Wiki customisation
  • 22.
    “ System [interface]messages” Edit MediaWiki: pages to overrride defaults (sysops only) Search on Special:Allmessages to find the right message/page MediaWiki namespace Manual:System message
  • 23.
  • 24.
    Users can customizetheir own view! MediaWiki:Common.css MediaWiki:Common.js Monobook skin: (same for others) MediaWiki:Monobook.css MediaWiki:Monobook.js Look & feel
  • 25.
    Massively simplify userJS/CSS sharing: no more copying user subpages MediaWiki:Gadgets-definition -> New Preferences tab JS/CSS Gadgets Extension:Gadgets
  • 26.
  • 27.
  • 28.
    Make your editbox less scary: Gadget rec: wikEd http://enwp.org/WP:WIKED
  • 29.
    The way toadd random PHP code to extend MediaWiki's functionality ~1500 already available Quality varies widely Stick to those already live on Wikimedia projects... Extensions Manual:Extensions
  • 30.
    Adds Editor,Reviewer user classes Page revisions must be approved before they go live to public Comments and quality flags for pages Being rolled out on Wikipedia now FlaggedRevs Extension:FlaggedRevs
  • 31.
    When categories aren'tenough... Semantic tags in content [[name::Melbourne]] [[place::city]] [[pop::3609734]] SQL-type queries across content {{#ask: [[place::city]] [[pop::>1000000]] | ?name }} Semantic Mediawiki semanticmediawiki.org
  • 32.
    A “bot” isreally just a script/program that connects to MediaWiki Can do anything than a human can Automatic running -> “bot” Special flag can hide bot edits Older bots used screen scraping pymediawiki framework Bots Help:Bots
  • 33.
    HTTP-based interface for(almost) all MediaWiki operations Flexible, tested and doesn't break every time the Wiki skin changes Wide range of language libraries Ruby support pretty poor though... MediaWiki API mediawiki.org/wiki/API
  • 34.
    Query (XML) Parse(= render as HTML) Edit, delete, move Bulk import, export (again XML) API operations mediawiki.org/wiki/API
  • 35.
    http://mediawiki.org ishalf-decent now Still lots of info on http://meta.wikimedia.org/ IRC is popular: irc://irc.freenode.net/mediawiki MLs: mediawiki-l Forum: http://mwusers.com/ (unofficial) Support
  • 36.
    Questions? Jani Patokallio<jani@contentshare.sg> Original slides by Brianna Laugher <brianna@modernthings.org> These slides are dual-licensed GFDL1.2+, CC-BY-SA-3.0. Screenshots are GFDL/GPL, WMF logo is all rights reserved, MediaWiki logo is public domain. Thank you!

Editor's Notes

  • #6 Links are fundamentally one-way (A to B), but Mediawiki gives a couple of tools for working out