X??
codesThis is an old revision of the document!
Table of Contents
gil plugin
Compatible with DokuWiki
No compatibility info given!
The missing download url means that this extension cannot be installed via the Extension Manager. Please see Publishing a Plugin on dokuwiki.org. Recommended are public repository hosts like GitHub, GitLab or Bitbucket.
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
This plugin is Experimental! |
---|
gil
is a plugin I've developed for DokuWiki that performs a simple task: allow one to show currency conversions in a wiki page.
For that purpose, conversion data made available by Yahoo Finances (™, (C) and/or whatever) is accesed and used to convert a singular amount of currency in an indicated (“source”) currency to a list of intended (“target”) currencies. The result is shown as a (X)HTML tooltip so that clients can hover over the amount and check the conversions.
The plugin name “gil” is inspired by the homonymous, meta-universal currency used in the games of the Final Fantasy franchise. Yes, you guessed it: I'm a fan.
This plugin is based off of work from Sridhar Kuppalli, a developer who in his blog shows the audience how to use PHP to access the currency data from the online service and use it for conversion. Credits and original idea therefore go to the man. I've just adapted the idea to work in DokuWiki because I thought the nature and intended use of this software may make a plugin like this useful.
Syntax
To show currency conversions for a certain amount of national money, just precede it with two dollar signs, with no spacing whatsoever.
$$1500
As a result, the text is shown in the form “… XXX$1500 …” with the text “YYY$nnnn” as the tooltip, where XXX
is the currency code used as source and YYY
the one used as target; nnnn
is the result of the conversion from the source 1500 units shown in the example to the target currency. See the picture below for an example.
Details:
- The plugin syntax takes no parameters.
- Configuration is available via the Configuration Manager.
Install and Configure
Download and Install via Plugin Manager |
---|
To download and install this plugin point your DokuWiki's Plugin Manager to the following URL: dw-plugin-gil-latest.zip — this link always points to the most recent release. Or you can check up the Demo page.
To configure the plugin, just access the configuration manager and modify the following settings:
Plugin Parameter | Default Value | Usage |
---|---|---|
gil_source | USD | The source currency from which conversions will be performed. |
gil_targets | EUR | A comma-delimited list of target currencies to which conversions will be performed, and whose results will appear as the tooltip content. |
gil_showsource | false | If enabled, the ISO code of each currency will be shown before the amount for easier identification. |
The variables gil_source
and gil_targets
use the National Currency Codes defined by ISO 4217 (three-letter currency codes). You can check here for the official catalogue, if you feel like having the gil money to buy, that is; or you can use the Wikipedia link provided above which contains a listing of National Currency Codes sorted by country.
The plugin comes preconfigured to use USD
(US Dollar) to EUR
(Euro) conversion.
Other Details
Demo
Note language is Spanish but online translators shall do a good job with it.
Known Issues
Remember this plugin is in experimental stage.
What the plugin does is to retrieve currency conversion data live from Yahoo Finances. Because of the nature of the plugin, caching of the page is disabled. Remember that because it means if you put too many conversions in a page or are trying to convert to many different currencies, page loading will be quite slow.
For the moment, no caching whatsoever is implemented for the currency conversion data.
Also for the moment, the plugin takes integer amounts for currency only.
Source Code
Download and unpack from the links above to get a view of the Source Code.
Things to Be Done
The following improvements are planned for the next release:
- Decimal currency support, of course.
- Using the national currency symbol instead of the generic
$
. - Verification of source currency validity 1).
When will the major be released? Whenever it's ready.
Other Developments
Other Plugins by Luis Machuca B.: | plugin:progrecss plugin:tooltip plugin:clock plugin:divalign2 plugin:gil |
---|
Discussion
Leave your 's here and I'll try to prove some 's. — Luis Machuca B. 2009/06/21 00:48
The currency shown in the text needs some CSS formatting, maybe a dotted underline so the web page user moves their mouse over.
It currently doesn't have one because the syntax makes use of the<ABBR>
tag by the browser… I'll try and provide a sensible CSS styling for the next release. Much thanks! - — Luis Machuca B. 2009/06/21 23:45