Extension:MolHandler

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
MolHandler
Release status: experimental
px
Implementation Media
Description Integrated support for server side rendering of Chemical table files
Author(s) (Rillketalk)
Latest version 0.1.0 (2014-07-24)
MediaWiki 1.23+
Database changes Yes
License GNU General Public License 2.0 or later
Download
README
Example Example and testing site
Hooks used
MimeMagicInit
MimeMagicImproveFromExtension
MimeMagicGuessFromContent
Requires indigo-utils 1.1.12 or later and running SVG support
Translate the MolHandler extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

Work in progress C.f. Chemical Markup support for Wikimedia Commons.

The MolHandler extension allows you to display Chemical table files in wiki pages, using the same syntax as for image files. It includes a molfile editor enabling contributors to quickly draw structures.

Feature Overview[edit]

  • We are currently gathering desired features. Feel free commenting on the talk page.

Syntax synopsis[edit]

In addition to the image embed syntax, Mol Handler supports:

[[File:Benzene.mol]] 
Display a molecule file.
[[File:Benzene reacts with chlorine.rxn]]
Show a reaction.

Client support[edit]

For being able to draw chemical formulae, your users need at least:

  • Internet Explorer 6+
  • Firefox 3.5+
  • Safari 4+
  • Opera 9.6+
  • Chrome 2+

Note that we will not officially support Internet Explorer 6-9. You might submit patches, though. As for support of other browsers: (Current - 1) or Current.

Installation[edit]

  • If using Vagrant , install with vagrant roles enable molhandler --provision
Manual installation
  • You will want a recent version of indigo-depict or open babel in order to support rendering chemical table files. Vagrant does this automatically.
  • Download and place the file(s) in a directory called MolHandler in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'MolHandler' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'MolHandler' );, you need to use:

require_once "$IP/extensions/MolHandler/MolHandler.php";

Recommended extensions[edit]

You may want to test Extension:SVGEdit. It can be used to edit the created intermediate SVG by MolHandler adding frames or coloring atoms.

Configuration[edit]

Configuration variables and their default settings:

$wgMolConverterPath = '/usr/bin';
$wgMolConvertCommands = array(
   'babel' => array(
       'command' => '$path/babel -i$format $input $output',
       'supportedFormats' => array( 'mol' )
   ),
   'indigo' => array(
       'command' => '$path/indigo-depict $input $output',
       'supportedFormats' => array( 'mol', 'rxn' )
   ),
);
$wgMolConverter = 'indigo';

Minimal install under Ubuntu 14.04[edit]

$ sudo apt-get install indigo-utils
$ cd /path/to/mediaWiki_s_installation/
$ cd extensions/
$ git clone --depth 1 https://github.com/wikimedia/mediawiki-extensions-MolHandler.git MolHandler

Road Map[edit]

  • Features desired are being implemented in the next 3 weeks. Long-term support?

Notes[edit]