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 du 25 août 2006 à 09:59 (modifier) (défaire)
Gi (Discuter | Contributions)
(Bibtex extension)
Différence suivante →
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.
 +This file is describing the bibtex mediawiki extension.
 +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 result of this extension can be seen on our '''[[Publications]]''' page here.
 +
 +=== Install/Files ===
Currently this extension is available into 2 different releases : Currently this extension is available into 2 different releases :
* [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. * [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.
* [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''. * [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''.
-The result of this extension can be seen on our '''[[Publications]]''' page here. 
- 
-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.''' 
- 
-The instructions found in the readme files are also displayed here : 
- 
- This file is describing the bibtex mediawiki extension. 
- 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 :+Just unpack the extension archive into the extensions directory of your mediawiki root.
- =========================================================================+
- 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+
- ================ +
- +
- Just unpack the extension archive into the extensions directory of your+
- mediawiki root.+
tar -xvzf BibTex.tar.gz tar -xvzf BibTex.tar.gz
- If you want to use this extensions, edit the file LocalSettings.php located at+If you want to use this extensions, edit the file LocalSettings.php located at the root of your mediawiki and write down the line :
- the root of your mediawiki and write down the line :+
require_once( "extensions/BibTex/bibtex.php"); require_once( "extensions/BibTex/bibtex.php");
- Nice ! Your bibtex extension is working.+Nice ! Your bibtex extension is working.
- Several files are unpacked :+Several files are unpacked :
- - bibtex.php : the main extension file,+* bibtex.php : the main extension file,
- - bibtex.css : containing css hacks for the divpopup demo,+* bibtex.css : containing css hacks for the divpopup demo,
- - bibtex.js : a javascript file containing a few functions,+* bibtex.js : a javascript file containing a few functions,
- - bibstyle.php : a file containing all the configuration variables of the+* bibstyle.php : a file containing all the configuration variables of the extension.
- extension.+
 +=== Setup and configuration ===
 +Edit your bibstyle.php file.
 +There are several things you can customize in it, starting with the languageyou want to use (in this package it is french - don't worry, there are rough translations in english).
- 2. Setup and configuration+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
- Edit your bibstyle.php file.+There are also two special variables :
- There are several things you can customize in it, starting with the language+$wbib_pdficon and $wbib_psicon : you should give for them the name of an image
- you want to use (in this package it is french - don't worry, there are rough+file you uploaded on your mediawiki server. It allows to change these icons
- translations in english).+later without having to use something else than a web browser. So do not
 +forget to put an image.
- 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 :+=== Use and online help mecanism ===
- $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.+
 +If you want to put a bibtex reference into the page you're editing, just put
 +it between <nowiki><bibtex> and </bibtex></nowiki> markups.
- 3. Use and online help mecanism+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 want to put a bibtex reference into the page you're editing, just put+{{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.}}
- it between <nowiki><bibtex> and </bibtex></nowiki> markups.+
- Personnally, I don't know every bibtex entry exact spelling nor the required+If you put just a @type between your bibtex markups (where type is article,
- fields of them. So I implemented a help mecanism.+book, etc ...), you will have the corresponding help related to this entry
- If in your edit you put only whitespaces between your bibtex markups and click+type with the same javascript mecanism.
- 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.+
- !!! Be careful ! It also delete everything else. this feature is useful if you 
- !!! 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,+Once your entry is edited, you can save it. If you had specified the following fields, some behavior will be added :
- book, etc ...), you will have the corresponding help related to this entry+* 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.
- type with the same javascript mecanism.+* 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.
- 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.+=== How do I use this extension with mediawiki ===
- 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.+
 +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. How do I use this extension with mediawiki+==== Template:Bibtex ====
- =============================================+
- Well, I admit I use it with templates. The aim is to put one reference per+Here is its code :
- 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 accordingly.
- 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]]
- +
- +
- [[Jean-Yves Didier/en|Jean-Yves Didier]] -- Thu, Jul 27, 2006+

Version du 25 août 2006 à 09:59

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

Sommaire

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.

Install/Files

Currently this extension is available into 2 different releases :


Just unpack the extension archive into the extensions directory of your mediawiki root.

        tar -xvzf BibTex.tar.gz

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/BibTex/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.

Setup and configuration

Edit your bibstyle.php file. There are several things you can customize in it, starting with the languageyou 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.


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.


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 :

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.

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

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 accordingly.

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.

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.

Maintainer

Jean-Yves Didier