I am the author of the comp.soft-sys.math.mathematica message linked by Szabolcs, wherein I briefly mentioned a CDF extension for MediaWiki I have developed. In the few days since I sent that message, I have improved the extension so that meets MediaWiki's best practice guidelines for extensions, and added new features: it can show CDF files uploaded to a wiki in wiki pages using a simple syntax, it can optionally show CDF files from other servers, and you can configure it to show a 'download' link beneath each CDF so that users may view the file offline if they want.
Full documentation for the extension, including installation instructions and examples, is given on the extension's page on mediawiki.org at http://www.mediawiki.org/wiki/Extension:WolframCDF but a brief summary of the page follows.
Note that this extension will only work with MediaWiki 1.17 or later. Earlier versions of MediaWiki do not include the Resource Loader system this relies on.[/edit]
To install the extension, download a zip archive of the latest version, unpack it and place the wolfram_cdf directory in your mediawiki extensions directory. Add the following to your wiki's LocalSettings.php file:
You will also need to ensure that file uploads are enabled, and .cdf file extensions are allowed, to do this your LocalSettings.php will need to include code like:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'txt', 'cdf' );
You may also need to either ensure that your webserver serves up .cdf files with the mime type
application/x-netcdf or, if that is not possible, you may need to modify your wiki's
includes/mime.types to contain
text/plain txt cdf
otherwise uploading CDF files may fail. Once the extension is installed, you can show CDF files in wiki pages by following these steps:
- upload your CDF file to the wiki
- place a
<cdf width="width in pixels" height="height in pixels">filename</cdf> tag in the page where you want the CDF file to appear.
For example, if you upload a 500x600 pixel CDF file called "MyDemonstration.cdf" to the wiki, you can show it in a page using
More configuration options and examples are provided on the MediaWiki.org page linked above.