Mediawiki extensions

Un article de Wiki-evr@.

(Différences entre les versions)
Version du 24 août 2006 à 14:54 (modifier)
Gi (Discuter | Contributions)
(Bibtex extension)
← Différence précédente
Version actuelle (25 janvier 2007 à 15:08) (modifier) (défaire)
Gi (Discuter | Contributions)
(Setup and configuration)
 
(7 révisions intermédiaires masquées)
Ligne 5 : Ligne 5 :
We don't know if it works for other versions. Any reports on this matter are of course welcomed. We don't know if it works for other versions. Any reports on this matter are of course welcomed.
-Currently this extension is available into 2 different releases :+This file is describing the bibtex mediawiki extension.
-* [http://gsc2.cemif.univ-evry.fr/images/5/59/Mediawiki-Bibtex-0.9.tar.gz Mediawiki-Bibtex-0.9] for a use with a clean mediawiki distribution.+In itself it has several features :
-* [http://gsc2.cemif.univ-evry.fr/images/0/04/Mediawiki-Bibtex-0.9-restrict.tar.gz Mediawiki-Bibtex-0.9-restrict] for a use with a mediawiki distribution patched with ''restrict extension''.+* Direct parsing of a bibtex entry placed between <nowiki><bibtex> and </bibtex></nowiki> markups,
 +* ACM-like popup style to quickly copy-paste a bibtex reference,
 +* A limited but usefull emacs-like help mecanism to edit bibtex entries,
 +* A div popup demo (not IE compliant nor XHTML transitionnal).
The result of this extension can be seen on our '''[[Publications]]''' page here. The result of this extension can be seen on our '''[[Publications]]''' page here.
 +
 +=== Install/Files ===
 +==== Downloads ====
 +Each release has to flavours : one for a standard mediawiki engine, and one for the mediawiki engine patched with the ''restrict extension''.
 +See also the [[#Change Logs|change logs]] for more details.
 +{|
 +| style="background: #7090b2; color: white; " |'''Current releases'''
 +|-
 +| align="right" | '''0.9.1'''
 +| ''(2006-09-02)''
 +|[http://gsc2.cemif.univ-evry.fr/images/3/30/Mediawiki-Bibtex-0.9.1.tar.gz <image>source="Tgz.png"</image>'''tar.gz'''][http://gsc2.cemif.univ-evry.fr/images/4/43/Mediawiki-Bibtex-0.9.1.zip <image>source="Zip.png"</image>'''zip''']
 +|-
 +| align="right" | '''0.9.1-restrict'''
 +| ''(2006-09-02)''
 +|[http://gsc2.cemif.univ-evry.fr/images/d/d0/Mediawiki-Bibtex-0.9.1-restrict.tar.gz <image>source="Tgz.png"</image>'''tar.gz'''][http://gsc2.cemif.univ-evry.fr/images/4/4b/Mediawiki-Bibtex-0.9.1-restrict.zip <image>source="Zip.png"</image>'''zip''']
 +|-
 +| style="background: #89afd9; color: white;"| '''Older releases'''
 +|-
 +| align="right" | '''0.9'''
 +| ''(2006-07-27)''
 +|[http://gsc2.cemif.univ-evry.fr/images/5/59/Mediawiki-Bibtex-0.9.tar.gz <image>source="Tgz.png"</image>'''tar.gz'''][http://gsc2.cemif.univ-evry.fr/images/f/f2/Mediawiki-Bibtex-0.9.zip <image>source="Zip.png"</image>'''zip''']
 +|-
 +| align="right" | '''0.9-restrict'''
 +| ''(2006-07-27)''
 +|[http://gsc2.cemif.univ-evry.fr/images/0/04/Mediawiki-Bibtex-0.9-restrict.tar.gz <image>source="Tgz.png"</image>'''tar.gz'''][http://gsc2.cemif.univ-evry.fr/images/7/77/Mediawiki-Bibtex-0.9-restrict.zip <image>source="Zip.png"</image>'''zip''']
 +|}
-There isn't really any license associated to it. Feel free to use it as you wish. This code can be shared without any restrictions.+
-Be aware that, in GPL-like terms, '''this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'''+==== Installation ====
 +Just unpack the tarball into the extensions directory of your mediawiki root (or unzip the archive in the appropriate folder if you choose zip distro):
 + tar -xvzf Mediawiki-Bibtex-xyz.tar.gz
 +Rename the unpacked folder to BibTex otherwise js/css files won't work with it :
 + mv Mediawiki-Bibtex-xyz BibTex
-The instructions found in the readme files are also displayed here :+If you want to use this extensions, edit the file <tt>LocalSettings.php</tt> located at the root of your mediawiki and write down the line :
 + require_once( "extensions/Mediawiki-Bibtex-xyz/bibtex.php");
 +Nice ! Your bibtex extension is working.
 +
 +Several files are unpacked :
 +* bibtex.php : the main extension file,
 +* bibtex.css : containing css hacks for the divpopup demo,
 +* bibtex.js : a javascript file containing a few functions,
 +* bibstyle.php : a file containing all the configuration variables of the extension,
 +* README.txt : a readme with almost the same instructions as here for install and configuration,
 +* ChangeLogs.txt : change logs (starting from 0.9.1 release).
- This file is describing the bibtex mediawiki extension.+=== Setup and configuration ===
- In itself it has several features :+
- - Direct parsing of a bibtex entry placed between <nowiki><bibtex> and </bibtex></nowiki>+
- markups,+
- - ACM-like popup style to quickly copy-paste a bibtex reference,+
- - A limited but usefull emacs-like help mecanism to edit bibtex entries,+
- - A div popup demo (not IE compliant nor XHTML transitionnal).+
- The remaining file is organized as follows :+Edit your bibstyle.php file.
- =========================================================================+There are several things you can customize in it, starting with the language you want to use (in this package it is french - don't worry, there are rough translations in english).
- 1. Install/Files+
- 2. Setup and configuration +
- 3. Use and online help mecanisms+
- 4. How do I use this extension with mediawiki (hint : templates)+
- 5. Credits and people who provided help+
- =========================================================================+
- 1. Install/Files+Some of the other useful variables to know are :
- ================ +* $wbib_usejavascript which enables/disables javascript use in this extension,
 +* $wbib_allowdivpopup which enables/disables the divpopup demo,
 +* $wbib_allowbibpopup which enbales/disables the ACM-like popup,
 +* $wbib_medianamespace giving the namespace of uploaded pdf or ps files on your mediawiki
- Just unpack the extension archive into the extensions directory of your+There are also two special variables :
- mediawiki root.+$wbib_pdficon and $wbib_psicon : you should give for them the name of an image
- tar -xvzf BibTex.tar.gz+file you uploaded on your mediawiki server. It allows to change these icons
- If you want to use this extensions, edit the file LocalSettings.php located at+later without having to use something else than a web browser. So do not
- the root of your mediawiki and write down the line :+forget to put an image.
- require_once( "extensions/BibTex/bibtex.php");+ 
- Nice ! Your bibtex extension is working.+=== Use and online help mecanism ===
- Several files are unpacked :+If you want to put a bibtex reference into the page you're editing, just put
- - bibtex.php : the main extension file,+it between <nowiki><bibtex> and </bibtex></nowiki> markups.
- - bibtex.css : containing css hacks for the divpopup demo,+
- - bibtex.js : a javascript file containing a few functions,+
- - bibstyle.php : a file containing all the configuration variables of the+
- extension.+
 +Personnally, I don't know every bibtex entry exact spelling nor the required
 +fields of them. So I implemented a help mecanism.
 +If in your edit you put only whitespaces between your bibtex markups and click
 +on the preview button, you will have a contextual help giving the names of
 +the entries you can enter. If javascript is enabled (default) you can click on
 +the entry type to display it in the edit textarea.
- 2. Setup and configuration+{{red|Be careful ! It also deletes everything else. this feature is useful if you only intent to put a single bibtex reference in the page.}}
- ==========================+
- Edit your bibstyle.php file.+If you put just a @type between your bibtex markups (where type is article,
- There are several things you can customize in it, starting with the language+book, etc ...), you will have the corresponding help related to this entry
- you want to use (in this package it is french - don't worry, there are rough+type with the same javascript mecanism.
- translations in english).+
- Some of the other useful variables to know are : 
- $wbib_usejavascript which enables/disables javascript use in this extension, 
- $wbib_allowdivpopup which enables/disables the divpopup demo, 
- $wbib_allowbibpopup which enbales/disables the ACM-like popup, 
- $wbib_medianamespace giving the namespace of uploaded pdf or ps files on your 
- mediawiki 
- There are also two special variables :+Once your entry is edited, you can save it. If you had specified the following fields, some behavior will be added :
- $wbib_pdficon and $wbib_psicon : you should give for them the name of an image+* the field pdf : you can put in it a pdf file uploaded in your mediawiki server (just the name without namespace - see bibstyle.php ). A link to this pdf will be automatically made using the icon you specified.
- file you uploaded on your mediawiki server. It allows to change these icons+* the same mecanism applies for postscript files and the bibtex field named 'ps'.
- later without having to use something else than a web browser. So do not+* the field url allows you to put an external reference to the article.
- forget to put an image.+
 +On the bottom of the reference, you have a 'bibtex' link.
 +If divpopup is enabled, then a div will appear with quite the same information
 +when you put the mouse over the link.
 +If bibpopup is enabled, then if you click on the link, an ACM-like popup will
 +appear containing the rawtext of the bibtex entry.
- 3. Use and online help mecanism 
- =============================== 
- If you want to put a bibtex reference into the page you're editing, just put+=== How do I use this extension with mediawiki ===
- it between <nowiki><bibtex> and </bibtex></nowiki> markups.+
- Personnally, I don't know every bibtex entry exact spelling nor the required+Well, I admit I use it with templates. The aim is to put one reference per
- fields of them. So I implemented a help mecanism.+page and then make links to it. It then allows to write the bibtex reference
- If in your edit you put only whitespaces between your bibtex markups and click+once and to use it many times. Then I use these references using three
- on the preview button, you will have a contextual help giving the names of+different templates :
- the entries you can enter. If javascript is enabled (default) you can click on+
- the entry type to display it in the edit textarea.+
- !!! Be careful ! It also delete everything else. this feature is useful if you+==== Template:Bibtex ====
- !!! only intent to put a single bibtex reference in the page.+
- If you put just a @type between your bibtex markups (where type is article,+Here is its code :
- book, etc ...), you will have the corresponding help related to this entry+
- type with the same javascript mecanism.+
- +
- +
- Once your entry is edited, you can save it. If you had specified the following+
- fields, some behavior will be added :+
- - the field pdf : you can put in it a pdf file uploaded in your mediawiki+
- server (just the name without namespace - see bibstyle.php ). A link to this+
- pdf will be automatically made using the icon you specified.+
- - the same mecanism applies for postscript files and the bibtex field named+
- 'ps'.+
- - the field url allows you to put an external reference to the article.+
- +
- On the bottom of the reference, you have a 'bibtex' link.+
- If divpopup is enabled, then a div will appear with quite the same information+
- when you put the mouse over the link.+
- If bibpopup is enabled, then if you click on the link, an ACM-like popup will+
- appear containing the rawtext of the bibtex entry.+
- +
- +
- 4. How do I use this extension with mediawiki+
- =============================================+
- +
- Well, I admit I use it with templates. The aim is to put one reference per+
- page and then make links to it. It then allows to write the bibtex reference+
- once and to use it many times. Then I use these references using three+
- different templates :+
- +
- 4.1 Template:Bibtex+
- +
- Here is its code :+
<nowiki><span id="{{{1}}}"> {{Bibtex/{{{1}}} }} </span></nowiki> <nowiki><span id="{{{1}}}"> {{Bibtex/{{{1}}} }} </span></nowiki>
- + 
- As you can see, I use a id for my bibtex reference.+As you can see, I use a id for my bibtex reference.
- Here they are on separate pages like this :+Here they are on separate pages like this :
Template:Bibtex/Id Template:Bibtex/Id
- The id is also used in the span markup to make references in a page.+The id is also used in the span markup to make references in a page.
- 4.2 Template:ref+==== Template:ref ====
- Here is its code :+Here is its code :
<nowiki>[{{SERVER}}{{localurl:{{PAGENAME}}}}#{{{1}}}]</nowiki> <nowiki>[{{SERVER}}{{localurl:{{PAGENAME}}}}#{{{1}}}]</nowiki>
- + 
- It looks like an external link with numbers in brackets.+It looks like an external link with numbers in brackets.
- The aim is to make a reference in the text of the page using this model and+The aim is to make a reference in the text of the page using this model and
- then put references at the bottom of the page using the template+then put references at the bottom of the page using the template
Template:Bibtex Template:Bibtex
- 4.3 Template:refa+==== Template:refa ====
- Here is its code :+Here is its code :
<nowiki>[[Template:Bibtex/{{{1}}} | [{{{1}}}]]]</nowiki> <nowiki>[[Template:Bibtex/{{{1}}} | [{{{1}}}]]]</nowiki>
 +
 +You can put it in your text. The link will go to the template page in which
 +your refernced your bibtex entry. According to the kind of key you generated,
 +you can have an apalike style in your written text.
- You can put it in your text. The link will go to the template page in which+Well, this is not the only way to use the bibtex extension but keep in mind
- your refernced your bibtex entry. According to the kind of key you generated,+the extension was developped with this kind of scheme underneath.
- you can have an apalike style in your written text.+It may be more appropriate to create a specific namespace called Bibtex and then
 +modify templates according.
 + 
 +=== Change Logs ===
 +*0.9.1 (2006-09-03)
 +*: Fixes on some uncritical annoying php errors flooding webserver logs.
 +*0.9 (2006-07-27)
 +*: Initial version.
 + 
 + 
- Well, this is not the only way to use the bibtex extension but keep in mind+=== Credits and people who provided help ===
- the extension was developped with this kind of scheme underneath.+I wish to thank :
- It may be more appropriate to create a specific namespace called Bibtex and then+* Vincent Le Ligeour for its divpopup demo,
- modify templates accordingly.+* Aurélien Hazan as a beta tester of this extension,
- +* Kinh Tieu for developping and distributing the bibtex class without restriction. It was a great help.
- 5. Credits and people who provided help+* Louis-Philippe Morency who informed me about the status of the bibtex class developped by Kinh Tieu.
- =======================================+ 
- I wish to thank :+=== License ===
- - Vincent Le Ligeour for its divpopup demo,+ 
- - Aurélien Hazan as a beta tester of this extension,+There isn't really any license associated to it. Feel free to use it as you wish. This code can be shared without any restrictions.
- - Kinh Tieu for developping and distributing the bibtex class without restriction.+Be aware that, in GPL-like terms, '''this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'''
- It was a great help.+ 
- - Louis-Philippe Morency who informed me about the status of the bibtex class+=== Maintainer ===
- developped by Kinh Tieu.+[[Jean-Yves Didier/en|Jean-Yves Didier]]
- + 
- +PS: I'm not really a php programmer. There should be more optimized way to achieve the same result. Suggestions and patches are welcome !
- [[Jean-Yves Didier/en|Jean-Yves Didier]] -- Thu, Jul 27, 2006+

Version actuelle

Here is a page of some mediawiki extensions developped for this wiki.

Sommaire

[modifier] Bibtex extension

This extension is developped for Mediawiki 1.5.2. We don't know if it works for other versions. Any reports on this matter are of course welcomed.

This file is describing the bibtex mediawiki extension. In itself it has several features :

  • Direct parsing of a bibtex entry placed between <bibtex> and </bibtex> markups,
  • ACM-like popup style to quickly copy-paste a bibtex reference,
  • A limited but usefull emacs-like help mecanism to edit bibtex entries,
  • A div popup demo (not IE compliant nor XHTML transitionnal).

The result of this extension can be seen on our Publications page here.

[modifier] Install/Files

[modifier] Downloads

Each release has to flavours : one for a standard mediawiki engine, and one for the mediawiki engine patched with the restrict extension. See also the change logs for more details.

Current releases
0.9.1 (2006-09-02) tar.gzzip
0.9.1-restrict (2006-09-02) tar.gzzip
Older releases
0.9 (2006-07-27) tar.gzzip
0.9-restrict (2006-07-27) tar.gzzip


[modifier] Installation

Just unpack the tarball into the extensions directory of your mediawiki root (or unzip the archive in the appropriate folder if you choose zip distro):

        tar -xvzf Mediawiki-Bibtex-xyz.tar.gz

Rename the unpacked folder to BibTex otherwise js/css files won't work with it :

        mv Mediawiki-Bibtex-xyz BibTex

If you want to use this extensions, edit the file LocalSettings.php located at the root of your mediawiki and write down the line :

        require_once( "extensions/Mediawiki-Bibtex-xyz/bibtex.php");

Nice ! Your bibtex extension is working.

Several files are unpacked :

  • bibtex.php : the main extension file,
  • bibtex.css : containing css hacks for the divpopup demo,
  • bibtex.js  : a javascript file containing a few functions,
  • bibstyle.php : a file containing all the configuration variables of the extension,
  • README.txt : a readme with almost the same instructions as here for install and configuration,
  • ChangeLogs.txt : change logs (starting from 0.9.1 release).

[modifier] Setup and configuration

Edit your bibstyle.php file. There are several things you can customize in it, starting with the language you want to use (in this package it is french - don't worry, there are rough translations in english).

Some of the other useful variables to know are :

  • $wbib_usejavascript which enables/disables javascript use in this extension,
  • $wbib_allowdivpopup which enables/disables the divpopup demo,
  • $wbib_allowbibpopup which enbales/disables the ACM-like popup,
  • $wbib_medianamespace giving the namespace of uploaded pdf or ps files on your mediawiki

There are also two special variables : $wbib_pdficon and $wbib_psicon : you should give for them the name of an image file you uploaded on your mediawiki server. It allows to change these icons later without having to use something else than a web browser. So do not forget to put an image.

[modifier] Use and online help mecanism

If you want to put a bibtex reference into the page you're editing, just put it between <bibtex> and </bibtex> markups.

Personnally, I don't know every bibtex entry exact spelling nor the required fields of them. So I implemented a help mecanism. If in your edit you put only whitespaces between your bibtex markups and click on the preview button, you will have a contextual help giving the names of the entries you can enter. If javascript is enabled (default) you can click on the entry type to display it in the edit textarea.


If you put just a @type between your bibtex markups (where type is article, book, etc ...), you will have the corresponding help related to this entry type with the same javascript mecanism.


Once your entry is edited, you can save it. If you had specified the following fields, some behavior will be added :

  • the field pdf : you can put in it a pdf file uploaded in your mediawiki server (just the name without namespace - see bibstyle.php ). A link to this pdf will be automatically made using the icon you specified.
  • the same mecanism applies for postscript files and the bibtex field named 'ps'.
  • the field url allows you to put an external reference to the article.

On the bottom of the reference, you have a 'bibtex' link. If divpopup is enabled, then a div will appear with quite the same information when you put the mouse over the link. If bibpopup is enabled, then if you click on the link, an ACM-like popup will appear containing the rawtext of the bibtex entry.


[modifier] How do I use this extension with mediawiki

Well, I admit I use it with templates. The aim is to put one reference per page and then make links to it. It then allows to write the bibtex reference once and to use it many times. Then I use these references using three different templates :

[modifier] Template:Bibtex

Here is its code :

<span id="{{{1}}}"> {{Bibtex/{{{1}}} }} </span>

As you can see, I use a id for my bibtex reference. Here they are on separate pages like this :

Template:Bibtex/Id

The id is also used in the span markup to make references in a page.

[modifier] Template:ref

Here is its code :

[{{SERVER}}{{localurl:{{PAGENAME}}}}#{{{1}}}]

It looks like an external link with numbers in brackets. The aim is to make a reference in the text of the page using this model and then put references at the bottom of the page using the template

Template:Bibtex

[modifier] Template:refa

Here is its code :

[[Template:Bibtex/{{{1}}} | [{{{1}}}]]]

You can put it in your text. The link will go to the template page in which your refernced your bibtex entry. According to the kind of key you generated, you can have an apalike style in your written text.

Well, this is not the only way to use the bibtex extension but keep in mind the extension was developped with this kind of scheme underneath. It may be more appropriate to create a specific namespace called Bibtex and then modify templates according.

[modifier] Change Logs

  • 0.9.1 (2006-09-03)
    Fixes on some uncritical annoying php errors flooding webserver logs.
  • 0.9 (2006-07-27)
    Initial version.


[modifier] Credits and people who provided help

I wish to thank :

  • Vincent Le Ligeour for its divpopup demo,
  • Aurélien Hazan as a beta tester of this extension,
  • Kinh Tieu for developping and distributing the bibtex class without restriction. It was a great help.
  • Louis-Philippe Morency who informed me about the status of the bibtex class developped by Kinh Tieu.

[modifier] License

There isn't really any license associated to it. Feel free to use it as you wish. This code can be shared without any restrictions. Be aware that, in GPL-like terms, this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[modifier] Maintainer

Jean-Yves Didier

PS: I'm not really a php programmer. There should be more optimized way to achieve the same result. Suggestions and patches are welcome !