WikiLink - The Mediawiki Interface: Difference between revisions

From Knot Atlas
Jump to navigationJump to search
No edit summary
 
(90 intermediate revisions by 51 users not shown)
Line 3: Line 3:
WikiLink is available as a standalone package, suitable for use with any Mediawiki installation, and is included in the [[KnotTheory`]] package.
WikiLink is available as a standalone package, suitable for use with any Mediawiki installation, and is included in the [[KnotTheory`]] package.


====License====
morgan, john pierpont [http://licata-riccardo.topo20.org licata, riccardo] - [HTTP://licata-riccardo.topo20.org licata, riccardo]: licata, riccardo licata, riccardo licata, riccardo [http://licata-riccardo.topo20.org licata, riccardo], [http://hell.fifa2007it.org hell] - [HTTP://hell.fifa2007it.org hell]: hell hell hell [http://hell.fifa2007it.org hell], [http://ackermann-max.trevisos.org ackermann, max] - [HTTP://ackermann-max.trevisos.org ackermann, max]: ackermann, max ackermann, max ackermann, max [http://ackermann-max.trevisos.org ackermann, max], [http://qixia-si.realitsen.info qixia si] - [HTTP://qixia-si.realitsen.info qixia si]: qixia si qixia si qixia si [http://qixia-si.realitsen.info qixia si], [http://alex-and.design4italy.org alex and emma] - [HTTP://alex-and.design4italy.org alex and emma]: alex and emma alex and emma alex and emma [http://alex-and.design4italy.org alex and emma], [http://capelle-jan.win-for-italy.info capelle, jan van de-] - [HTTP://capelle-jan.win-for-italy.info capelle, jan van de-]: capelle, jan van de- capelle, jan van de- capelle, jan van de- [http://capelle-jan.win-for-italy.info capelle, jan van de-], [http://bikom.trevisos.org bikom] - [HTTP://bikom.trevisos.org bikom]: bikom bikom bikom [http://bikom.trevisos.org bikom], [http://paraylemonial.realitsen.info paray-le-monial] - [HTTP://paraylemonial.realitsen.info paray-le-monial]: paray-le-monial paray-le-monial paray-le-monial [http://paraylemonial.realitsen.info paray-le-monial], [http://mitsuyoshi-tosa.realitsen.info mitsuyoshi tosa] - [HTTP://mitsuyoshi-tosa.realitsen.info mitsuyoshi tosa]: mitsuyoshi tosa mitsuyoshi tosa mitsuyoshi tosa [http://mitsuyoshi-tosa.realitsen.info mitsuyoshi tosa], [http://four-brothers.fifa2007it.org four brothers - quattro fratelli] - [HTTP://four-brothers.fifa2007it.org four brothers - quattro fratelli]: four brothers - quattro fratelli four brothers - quattro fratelli four brothers - quattro fratelli [http://four-brothers.fifa2007it.org four brothers - quattro fratelli], [http://baumhauer-joseph.trevisos.org baumhauer, joseph] - [HTTP://baumhauer-joseph.trevisos.org baumhauer, joseph]: baumhauer, joseph baumhauer, joseph baumhauer, joseph [http://baumhauer-joseph.trevisos.org baumhauer, joseph], [http://bentley-john.trevisos.org bentley, john francis] - [HTTP://bentley-john.trevisos.org bentley, john francis]: bentley, john francis bentley, john francis bentley, john francis [http://bentley-john.trevisos.org bentley, john francis], [http://konarak.topo20.org konarak] - [HTTP://konarak.topo20.org konarak]: konarak konarak konarak [http://konarak.topo20.org konarak], [http://beauvais.trevisos.org beauvais] - [HTTP://beauvais.trevisos.org beauvais]: beauvais beauvais beauvais [http://beauvais.trevisos.org beauvais], [http://il-viaggio.motnolado.org il viaggio di felicia] - [HTTP://il-viaggio.motnolado.org il viaggio di felicia]: il viaggio di felicia il viaggio di felicia il viaggio di felicia [http://il-viaggio.motnolado.org il viaggio di felicia], [http://fanum-voltumnae.win-for-italy.info fanum voltumnae] - [HTTP://fanum-voltumnae.win-for-italy.info fanum voltumnae]: fanum voltumnae fanum voltumnae fanum voltumnae [http://fanum-voltumnae.win-for-italy.info fanum voltumnae], [http://halle.topo20.org halle] - [HTTP://halle.topo20.org halle]: halle halle halle [http://halle.topo20.org halle], [http://divisionismo.win-for-italy.info divisionismo] - [HTTP://divisionismo.win-for-italy.info divisionismo]: divisionismo divisionismo divisionismo [http://divisionismo.win-for-italy.info divisionismo], [http://vivin-louis.design4italy.org vivin, louis] - [HTTP://vivin-louis.design4italy.org vivin, louis]: vivin, louis vivin, louis vivin, louis [http://vivin-louis.design4italy.org vivin, louis], [http://thule-springs.design4italy.org thule springs] - [HTTP://thule-springs.design4italy.org thule springs]: thule springs thule springs thule springs [http://thule-springs.design4italy.org thule springs], [http://abercrombie-sir.trevisos.org abercrombie, sir patrick] - [HTTP://abercrombie-sir.trevisos.org abercrombie, sir patrick]: abercrombie, sir patrick abercrombie, sir patrick abercrombie, sir patrick [http://abercrombie-sir.trevisos.org abercrombie, sir patrick], [http://tessenow-heinrich.design4italy.org tessenow heinrich] - [HTTP://tessenow-heinrich.design4italy.org tessenow heinrich]: tessenow heinrich tessenow heinrich tessenow heinrich [http://tessenow-heinrich.design4italy.org tessenow heinrich], [http://ebrach.win-for-italy.info ebrach] - [HTTP://ebrach.win-for-italy.info ebrach]: ebrach ebrach ebrach [http://ebrach.win-for-italy.info ebrach], [http://piattabanda.realitsen.info piattabanda] - [HTTP://piattabanda.realitsen.info piattabanda]: piattabanda piattabanda piattabanda [http://piattabanda.realitsen.info piattabanda], [http://piles-roger.realitsen.info piles, roger de-] - [HTTP://piles-roger.realitsen.info piles, roger de-]: piles, roger de- piles, roger de- piles, roger de- [http://piles-roger.realitsen.info piles, roger de-], [http://charlotte-gray.fifa2007it.org charlotte gray] - [HTTP://charlotte-gray.fifa2007it.org charlotte gray]: charlotte gray charlotte gray charlotte gray [http://charlotte-gray.fifa2007it.org charlotte gray], [http://mills-robert.realitsen.info mills, robert] - [HTTP://mills-robert.realitsen.info mills, robert]: mills, robert mills, robert mills, robert [http://mills-robert.realitsen.info mills, robert], [http://belfagor-.fifa2007it.org belfagor - il fantasma del louvre] - [HTTP://belfagor-.fifa2007it.org belfagor - il fantasma del louvre]: belfagor - il fantasma del louvre belfagor - il fantasma del louvre belfagor - il fantasma del louvre [http://belfagor-.fifa2007it.org belfagor - il fantasma del louvre], [http://cenerentola-a.fifa2007it.org cenerentola a parigi] - [HTTP://cenerentola-a.fifa2007it.org cenerentola a parigi]: cenerentola a parigi cenerentola a parigi cenerentola a parigi [http://cenerentola-a.fifa2007it.org cenerentola a parigi], [http://la-spirale.motnolado.org la spirale della vendetta] - [HTTP://la-spirale.motnolado.org la spirale della vendetta]: la spirale della vendetta la spirale della vendetta la spirale della vendetta [http://la-spirale.motnolado.org la spirale della vendetta], [http://praetexta.realitsen.info praetexta] - [HTTP://praetexta.realitsen.info praetexta]: praetexta praetexta praetexta [http://praetexta.realitsen.info praetexta], [http://fashion.win-for-italy.info fashion] - [HTTP://fashion.win-for-italy.info fashion]: fashion fashion fashion [http://fashion.win-for-italy.info fashion], [http://hilton-roger.topo20.org hilton, roger] - [HTTP://hilton-roger.topo20.org hilton, roger]: hilton, roger hilton, roger hilton, roger [http://hilton-roger.topo20.org hilton, roger], [http://lavedan-pierre.topo20.org lavedan, pierre] - [HTTP://lavedan-pierre.topo20.org lavedan, pierre]: lavedan, pierre lavedan, pierre lavedan, pierre [http://lavedan-pierre.topo20.org lavedan, pierre], [http://pontecagnano-faiano.realitsen.info pontecagnano faiano] - [HTTP://pontecagnano-faiano.realitsen.info pontecagnano faiano]: pontecagnano faiano pontecagnano faiano pontecagnano faiano [http://pontecagnano-faiano.realitsen.info pontecagnano faiano], [http://susanna.design4italy.org susanna] - [HTTP://susanna.design4italy.org susanna]: susanna susanna susanna [http://susanna.design4italy.org susanna], [http://bambole-russe.fifa2007it.org bambole russe] - [HTTP://bambole-russe.fifa2007it.org bambole russe]: bambole russe bambole russe bambole russe [http://bambole-russe.fifa2007it.org bambole russe], [http://commedia-sexy.fifa2007it.org commedia sexy] - [HTTP://commedia-sexy.fifa2007it.org commedia sexy]: commedia sexy commedia sexy commedia sexy [http://commedia-sexy.fifa2007it.org commedia sexy], [http://bukezukuri.trevisos.org buke-zukuri] - [HTTP://bukezukuri.trevisos.org buke-zukuri]: buke-zukuri buke-zukuri buke-zukuri [http://bukezukuri.trevisos.org buke-zukuri], [http://costantino-i.win-for-italy.info costantino i (imperatore romano)] - [HTTP://costantino-i.win-for-italy.info costantino i (imperatore romano)]: costantino i (imperatore romano) costantino i (imperatore romano) costantino i (imperatore romano) [http://costantino-i.win-for-italy.info costantino i (imperatore romano)], [http://pawdawmu.realitsen.info pawdawmu] - [HTTP://pawdawmu.realitsen.info pawdawmu]: pawdawmu pawdawmu pawdawmu [http://pawdawmu.realitsen.info pawdawmu], [http://gioco-a.fifa2007it.org gioco a due] - [HTTP://gioco-a.fifa2007it.org gioco a due]: gioco a due gioco a due gioco a due [http://gioco-a.fifa2007it.org gioco a due], [http://leptis-magna.topo20.org leptis magna] - [HTTP://leptis-magna.topo20.org leptis magna]: leptis magna leptis magna leptis magna [http://leptis-magna.topo20.org leptis magna], [http://killing-zoe.motnolado.org killing zoe] - [HTTP://killing-zoe.motnolado.org killing zoe]: killing zoe killing zoe killing zoe [http://killing-zoe.motnolado.org killing zoe], [http://puy-jean.realitsen.info puy, jean] - [HTTP://puy-jean.realitsen.info puy, jean]: puy, jean puy, jean puy, jean [http://puy-jean.realitsen.info puy, jean], [http://jerry-maguire.motnolado.org jerry maguire] - [HTTP://jerry-maguire.motnolado.org jerry maguire]: jerry maguire jerry maguire jerry maguire [http://jerry-maguire.motnolado.org jerry maguire], [http://brouet-auguste.trevisos.org brouet, auguste] - [HTTP://brouet-auguste.trevisos.org brouet, auguste]: brouet, auguste brouet, auguste brouet, auguste [http://brouet-auguste.trevisos.org brouet, auguste], [http://pileta-la.realitsen.info pileta, la-] - [HTTP://pileta-la.realitsen.info pileta, la-]: pileta, la- pileta, la- pileta, la- [http://pileta-la.realitsen.info pileta, la-], [http://campanile.win-for-italy.info campanile] - [HTTP://campanile.win-for-italy.info campanile]: campanile campanile campanile [http://campanile.win-for-italy.info campanile], [http://arrieta-pedro.trevisos.org arrieta, pedro de-] - [HTTP://arrieta-pedro.trevisos.org arrieta, pedro de-]: arrieta, pedro de- arrieta, pedro de- arrieta, pedro de- [http://arrieta-pedro.trevisos.org arrieta, pedro de-], [http://cambridge-usa.win-for-italy.info cambridge (u.s.a.)] - [HTTP://cambridge-usa.win-for-italy.info cambridge (u.s.a.)]: cambridge (u.s.a.) cambridge (u.s.a.) cambridge (u.s.a.) [http://cambridge-usa.win-for-italy.info cambridge (u.s.a.)], [http://arellano-juan.trevisos.org arellano, juan de-] - [HTTP://arellano-juan.trevisos.org arellano, juan de-]: arellano, juan de- arellano, juan de- arellano, juan de- [http://arellano-juan.trevisos.org arellano, juan de-], [http://la-cameriera.motnolado.org la cameriera] - [HTTP://la-cameriera.motnolado.org la cameriera]: la cameriera la cameriera la cameriera [http://la-cameriera.motnolado.org la cameriera], [http://honegger-david.topo20.org honegger, david] - [HTTP://honegger-david.topo20.org honegger, david]: honegger, david honegger, david honegger, david [http://honegger-david.topo20.org honegger, david], [http://hals-frans.topo20.org hals, frans] - [HTTP://hals-frans.topo20.org hals, frans]: hals, frans hals, frans hals, frans [http://hals-frans.topo20.org hals, frans], [http://black-simphony.fifa2007it.org black simphony] - [HTTP://black-simphony.fifa2007it.org black simphony]: black simphony black simphony black simphony [http://black-simphony.fifa2007it.org black simphony], [http://last-night.motnolado.org last night] - [HTTP://last-night.motnolado.org last night]: last night last night last night [http://last-night.motnolado.org last night], [http://spencer-stanley.design4italy.org spencer, stanley] - [HTTP://spencer-stanley.design4italy.org spencer, stanley]: spencer, stanley spencer, stanley spencer, stanley [http://spencer-stanley.design4italy.org spencer, stanley], [http://gertrud.fifa2007it.org gertrud] - [HTTP://gertrud.fifa2007it.org gertrud]: gertrud gertrud gertrud [http://gertrud.fifa2007it.org gertrud], [http://tachi.design4italy.org tachi] - [HTTP://tachi.design4italy.org tachi]: tachi tachi tachi [http://tachi.design4italy.org tachi], [http://tisi-benvenuto.design4italy.org tisi, benvenuto] - [HTTP://tisi-benvenuto.design4italy.org tisi, benvenuto]: tisi, benvenuto tisi, benvenuto tisi, benvenuto [http://tisi-benvenuto.design4italy.org tisi, benvenuto], [http://novilara.realitsen.info novilara] - [HTTP://novilara.realitsen.info novilara]: novilara novilara novilara [http://novilara.realitsen.info novilara], [http://dragonfly.fifa2007it.org dragonfly] - [HTTP://dragonfly.fifa2007it.org dragonfly]: dragonfly dragonfly dragonfly [http://dragonfly.fifa2007it.org dragonfly], [http://ricostruire.design4italy.org ricostruire] - [HTTP://ricostruire.design4italy.org ricostruire]: ricostruire ricostruire ricostruire [http://ricostruire.design4italy.org ricostruire], [http://base-architettura.trevisos.org base (architettura)] - [HTTP://base-architettura.trevisos.org base (architettura)]: base (architettura) base (architettura) base (architettura) [http://base-architettura.trevisos.org base (architettura)], [http://muybridge-eadweard.realitsen.info muybridge, eadweard] - [HTTP://muybridge-eadweard.realitsen.info muybridge, eadweard]: muybridge, eadweard muybridge, eadweard muybridge, eadweard [http://muybridge-eadweard.realitsen.info muybridge, eadweard], [http://kahn-louis.topo20.org kahn, louis isadore] - [HTTP://kahn-louis.topo20.org kahn, louis isadore]: kahn, louis isadore kahn, louis isadore kahn, louis isadore [http://kahn-louis.topo20.org kahn, louis isadore], [http://looy-jacobus.topo20.org looy, jacobus van-] - [HTTP://looy-jacobus.topo20.org looy, jacobus van-]: looy, jacobus van- looy, jacobus van- looy, jacobus van- [http://looy-jacobus.topo20.org looy, jacobus van-], [http://confessions-a.fifa2007it.org confessions of a teenage drama queen] - [HTTP://confessions-a.fifa2007it.org confessions of a teenage drama queen]: confessions of a teenage drama queen confessions of a teenage drama queen confessions of a teenage drama queen [http://confessions-a.fifa2007it.org confessions of a teenage drama queen], [http://liberty.topo20.org liberty] - [HTTP://liberty.topo20.org liberty]: liberty liberty liberty [http://liberty.topo20.org liberty], [http://brinckmann-albert.trevisos.org brinckmann, albert erich] - [HTTP://brinckmann-albert.trevisos.org brinckmann, albert erich]: brinckmann, albert erich brinckmann, albert erich brinckmann, albert erich [http://brinckmann-albert.trevisos.org brinckmann, albert erich], [http://carne-tremula.fifa2007it.org carne tremula] - [HTTP://carne-tremula.fifa2007it.org carne tremula]: carne tremula carne tremula carne tremula [http://carne-tremula.fifa2007it.org carne tremula], [http://a-good.fifa2007it.org a good lawyer's wife] - [HTTP://a-good.fifa2007it.org a good lawyer's wife]: a good lawyer's wife a good lawyer's wife a good lawyer's wife [http://a-good.fifa2007it.org a good lawyer's wife], [http://bourgeois-victor.trevisos.org bourgeois, victor] - [HTTP://bourgeois-victor.trevisos.org bourgeois, victor]: bourgeois, victor bourgeois, victor bourgeois, victor [http://bourgeois-victor.trevisos.org bourgeois, victor], [http://gods-and.fifa2007it.org gods and generals] - [HTTP://gods-and.fifa2007it.org gods and generals]: gods and generals gods and generals gods and generals [http://gods-and.fifa2007it.org gods and generals], [http://fragile.fifa2007it.org fragile] - [HTTP://fragile.fifa2007it.org fragile]: fragile fragile fragile [http://fragile.fifa2007it.org fragile], [http://kitaj-ronald.topo20.org kitaj, ronald b.] - [HTTP://kitaj-ronald.topo20.org kitaj, ronald b.]: kitaj, ronald b. kitaj, ronald b. kitaj, ronald b. [http://kitaj-ronald.topo20.org kitaj, ronald b.], [http://foster-sir.win-for-italy.info foster, sir norman] - [HTTP://foster-sir.win-for-italy.info foster, sir norman]: foster, sir norman foster, sir norman foster, sir norman [http://foster-sir.win-for-italy.info foster, sir norman], [http://vos-cornelis.design4italy.org vos, cornelis de-] - [HTTP://vos-cornelis.design4italy.org vos, cornelis de-]: vos, cornelis de- vos, cornelis de- vos, cornelis de- [http://vos-cornelis.design4italy.org vos, cornelis de-], [http://swatch.design4italy.org swatch] - [HTTP://swatch.design4italy.org swatch]: swatch swatch swatch [http://swatch.design4italy.org swatch], [http://venet-bernard.design4italy.org venet, bernard] - [HTTP://venet-bernard.design4italy.org venet, bernard]: venet, bernard venet, bernard venet, bernard [http://venet-bernard.design4italy.org venet, bernard], [http://top.design4italy.org top] - [HTTP://top.design4italy.org top]: top top top [http://top.design4italy.org top], [http://mora.realitsen.info mora] - [HTTP://mora.realitsen.info mora]: mora mora mora [http://mora.realitsen.info mora], [http://big-fish.fifa2007it.org big fish] - [HTTP://big-fish.fifa2007it.org big fish]: big fish big fish big fish [http://big-fish.fifa2007it.org big fish], [http://bosch-y.trevisos.org bosch y gimpera, pedro] - [HTTP://bosch-y.trevisos.org bosch y gimpera, pedro]: bosch y gimpera, pedro bosch y gimpera, pedro bosch y gimpera, pedro [http://bosch-y.trevisos.org bosch y gimpera, pedro], [http://pailou.realitsen.info pailou] - [HTTP://pailou.realitsen.info pailou]: pailou pailou pailou [http://pailou.realitsen.info pailou], [http://nylon.realitsen.info nylon] - [HTTP://nylon.realitsen.info nylon]: nylon nylon nylon [http://nylon.realitsen.info nylon], [http://carlitos-way.fifa2007it.org carlito's way] - [HTTP://carlitos-way.fifa2007it.org carlito's way]: carlito's way carlito's way carlito's way [http://carlitos-way.fifa2007it.org carlito's way], [http://loggiato.topo20.org loggiato] - [HTTP://loggiato.topo20.org loggiato]: loggiato loggiato loggiato [http://loggiato.topo20.org loggiato], [http://avedon-richard.trevisos.org avedon, richard] - [HTTP://avedon-richard.trevisos.org avedon, richard]: avedon, richard avedon, richard avedon, richard [http://avedon-richard.trevisos.org avedon, richard], [http://orchard-william.realitsen.info orchard, william] - [HTTP://orchard-william.realitsen.info orchard, william]: orchard, william orchard, william orchard, william [http://orchard-william.realitsen.info orchard, william], [http://gremlins.fifa2007it.org gremlins] - [HTTP://gremlins.fifa2007it.org gremlins]: gremlins gremlins gremlins [http://gremlins.fifa2007it.org gremlins], [http://accademismo.trevisos.org accademismo] - [HTTP://accademismo.trevisos.org accademismo]: accademismo accademismo accademismo [http://accademismo.trevisos.org accademismo], [http://candela-felix.win-for-italy.info candela, felix] - [HTTP://candela-felix.win-for-italy.info candela, felix]: candela, felix candela, felix candela, felix [http://candela-felix.win-for-italy.info candela, felix], [http://azzolini-tito.trevisos.org azzolini, tito] - [HTTP://azzolini-tito.trevisos.org azzolini, tito]: azzolini, tito azzolini, tito azzolini, tito [http://azzolini-tito.trevisos.org azzolini, tito], [http://kiva.topo20.org kiva] - [HTTP://kiva.topo20.org kiva]: kiva kiva kiva [http://kiva.topo20.org kiva], [http://robert-luzarches.design4italy.org robert de luzarches] - [HTTP://robert-luzarches.design4italy.org robert de luzarches]: robert de luzarches robert de luzarches robert de luzarches [http://robert-luzarches.design4italy.org robert de luzarches], [http://del-perduto.fifa2007it.org del perduto amore] - [HTTP://del-perduto.fifa2007it.org del perduto amore]: del perduto amore del perduto amore del perduto amore [http://del-perduto.fifa2007it.org del perduto amore], [http://shumman-kubo.design4italy.org shumman, kubo] - [HTTP://shumman-kubo.design4italy.org shumman, kubo]: shumman, kubo shumman, kubo shumman, kubo [http://shumman-kubo.design4italy.org shumman, kubo], [http://morgan-john.realitsen.info morgan, john pierpont] - [HTTP://morgan-john.realitsen.info morgan, john pierpont]: morgan, john pierpont morgan, john pierpont morgan, john pierpont [http://morgan-john.realitsen.info morgan, john pierpont],
<tt>WikiLink.nb</tt>, <tt>WikiLink.m</tt> and <tt>wikilink.jar</tt> are copyright Scott Morrison, available under your choice of the MIT, Apache or GPL licenses. The other components are copyright by other parties, all available under the Apache license.


====Download====
====Download====
Line 163: Line 164:


=====String manipulation functions=====
=====String manipulation functions=====
<code>WikiLink`</code> provides functions WikiPageMatchQ, WikiPageFreeQ, WikiStringReplace and WikiStringCases. Each function works likes its usual Mathematica partner, [http://documents.wolfram.com/mathematica/functions/StringMatchQ StringMatchQ], [http://documents.wolfram.com/mathematica/functions/StringFreeQ StringFreeQ], [http://documents.wolfram.com/mathematica/functions/StringReplace StringReplace] or [http://documents.wolfram.com/mathematica/functions/StringCases StringCases]. Instead of providing a string, or list of strings, as the first argument, you should give the name of a page, or a list of names.
<code>WikiLink`</code> provides functions WikiPageMatchQ, WikiPageFreeQ, WikiStringReplace and WikiStringCases. Each function works likes its usual Mathematica partner,
[http://documents.wolfram.com/mathematica/functions/StringMatchQ StringMatchQ],
[http://documents.wolfram.com/mathematica/functions/StringFreeQ StringFreeQ],
[http://documents.wolfram.com/mathematica/functions/StringReplace StringReplace]
or [http://documents.wolfram.com/mathematica/functions/StringCases StringCases]. Instead of providing a string, or list of strings, as the first argument, you should give the name of a page, or a list of names.


You can use these to perform all sorts of editing tricks.
You can use these to perform all sorts of editing tricks.
Line 213: Line 218:


====Compatibility====
====Compatibility====
WikiLink (with some modifications made in July 2007) appears to work with mediawiki 1.10.1. Bug reports appreciated!

WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.
WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.



Latest revision as of 00:41, 28 May 2009

WikiLink is actually two separate things; firstly, a java class for interfacing with a mediawiki server, and secondly, a Mathematica package providing a wrapper around this. This page documents the Mathematica package, while the java class, and its addition functionality, will be documented elsewhere.

WikiLink is available as a standalone package, suitable for use with any Mediawiki installation, and is included in the KnotTheory` package.

License

WikiLink.nb, WikiLink.m and wikilink.jar are copyright Scott Morrison, available under your choice of the MIT, Apache or GPL licenses. The other components are copyright by other parties, all available under the Apache license.

Download

If you already have KnotTheory` installed, there's no need to install anything. The functionality of WikiLink is available as soon as you open KnotTheory`.

Otherwise, download WikiLink.zip. Unzip this anywhere you like. This will create a subdirectory called WikiLink, containing (at least) these files:

Filename Description
mathematica/WikiLink.nb The Mathematica notebook containing wrapper function definitions.
mathematica/WikiLink.m The Mathematica package automatically generated from WikiLink.nb.
wikilink.jar The WikiLink java classes and source code.

jars/jdom.jar
jars/commons-httpclient-3.0-rc2.jar
jars/commons-codec-1.3.jar
jars/commons-lang-2.1.jar
jars/commons-logging.jar

Libraries (all available under either GPL or the Apache license) required by wikilink.jar

Importing the package in Mathematica

If you're not using KnotTheory`, first, you'll need to set some paths, so WikiLink` can find the java files it needs. You need to add the "mathematica/" subdirectory of the WikiLink distribution to the Mathematica $Path.

In[1]:= WikiLinkPath = "/path/to/WikiLink/mathematica/";
In[2]:= AppendTo[$Path, WikiLinkPath];
In[3]:= <<WikiLink`

If you've already loaded KnotTheory` (e.g., with the statement <<KnotTheory`), you can simply begin at this point.

We then try to connect to the wiki. Executing this line will prompt you for a username and password.

In[6]:= CreateWikiConnection[ "http://katlas.math.toronto.edu/w/index.php", InputString["Enter Your Username:"], InputString["Enter Your Password:"] ]

The function WikiUserName[] checks that we're logged in

In[4]:= ?WikiUserName
WikiUserName[] returns either the name of the user you are logged in as, your IP address if you're not logged in, or $Failed if something more complicated has happened!
In[5]:= WikiUserName[]
Out[5]= ScottManualRobot

Usage

WikiLink` provides functions for checking your login status, getting and setting pages, as well as transparently extending some of Mathematica's string manipulation functions to wiki pages.

In[6]:= ?WikiUserName
WikiUserName[] returns either the name of the user you are logged in as, your IP address if you're not logged in, or $Failed if something more complicated has happened!
In[7]:= ?WikiGetPageText
WikiGetPageText[pagename] returns the raw text of the specified page.
In[8]:= ?WikiSetPageText
WikiSetPageText[pagename, text] overwrites the contents of the specificied page with the given text. WikiSetPageText[pagename, text, summary] overwrites the contents of the specificied page with the given text and notes summary in the change log.
In[9]:= ?WikiSetPageTexts
WikiSetPageText[{{pagename1, text1},{pagename2,text2},...}] efficiently sets multiple pages, by first checking which texts are already up to date.
In[10]:= ?WikiUploadFile
WikiUploadFile[name, description] uploads the specified file to the wiki.

Thus for example after

In[11]:= WikiSetPageText["Sandbox", "A robotic edit, at 19:39, 31-August-2005."]
Out[11]= True

we get

In[12]:= WikiGetPageText["Sandbox"]
Out[12]= A robotic edit, at 19:39, 31-August-2005.

The function WikiSetPageTexts is most useful for batch uploads, as it does considerably more error checking, and filters out edits which won't change the page text. It takes as argument a list of {"title", "text"} pairs, and returns a list of those pairs which failed.

In[13]:= WikiSetPageTexts[{{"Sandbox", "A robotic edit, by --~~"<>"~~"}, {"Sandbox2", "The determinant of the knot [[3_1]] is 3."}}]
Out[13]= {}
In[14]:= WikiGetPageText["Sandbox2"]
Out[14]= The determinant of the knot [[3_1]] is 3.
String manipulation functions

WikiLink` provides functions WikiPageMatchQ, WikiPageFreeQ, WikiStringReplace and WikiStringCases. Each function works likes its usual Mathematica partner, StringMatchQ, StringFreeQ, StringReplace or StringCases. Instead of providing a string, or list of strings, as the first argument, you should give the name of a page, or a list of names.

You can use these to perform all sorts of editing tricks.

In[15]:= WikiPageMatchQ[{"Sandbox", "Sandbox2"}, "determinant"]
Out[15]= {False, False}
In[16]:= WikiPageFreeQ[{"Sandbox", "Sandbox2"}, "[["~~(DigitCharacter..)~~"_"~~(DigitCharacter..)~~"]]"]
Out[16]= {True, False}
In[17]:= WikiStringCases[{"Sandbox", "Sandbox2"}, "[["~~ShortestMatch[__]~~"]]"]
Out[17]= {{Sandbox, {[[User:ScottManualRobot|ScottManualRobot]]}}, {Sandbox2, {[[3_1]]}}}
In[18]:= WikiStringReplace[{"Sandbox", "Sandbox2"}, "robotic edit"->"robotic edit (using WikiLink`)]
Out[18]= $Failed
In[19]:= WikiGetPageTexts[{"Sandbox", "Sandbox2"}]
Out[19]= {{Sandbox, A robotic edit, by\ --[[User:ScottManualRobot|ScottManualRobot]] 14:54, 18 Feb 2006\ (EST)}, {Sandbox2, The determinant of the knot [[3_1]] is 3.}}

Troubleshooting

The instruction ShowJavaConsole[] will bring up a window in which some debugging information is displayed.

Compatibility

WikiLink (with some modifications made in July 2007) appears to work with mediawiki 1.10.1. Bug reports appreciated!

WikiLink has been tested against mediawiki 1.4.5beta3 and 1.4.7.

WikiLink has known issues on mediawiki 1.5.0. Retrieving multiple pages at once is broken. This appears to be a mediawiki bug, and will not be fixed. The same problem does not occur on mediawiki 1.5.8. --Scott 10:56, 27 Mar 2006 (EST)

I expect WikiGetPage text to continue working in mediawiki 1.5 and beyond, because it uses the stable interface Special:Export. Logging in and setting pages will quite likely break in the next version. If you've tried this, please let me know about your experiences. I'm hoping that soon (1.5?) Special:Import will become available, and I can switch to using this. --Scott 15:57, 31 Aug 2005 (EDT)

Todo

I'd love to create an Ant task which allows uploading a file to a wiki. We could then use this in build scripts for KnotTheory, etc. --Scott 04:07, 17 Sep 2005 (EDT)

See Also

All of the Mathematica notebooks in Category:Knot Atlas Maintenance Software rely on WikiLink, and so are good examples of how to use it.

You may also be interested in the Wikipedia page on mediawiki bots, and in particular the Python Wikipedia Robot Framework.