Code covered by the BSD License  

Highlights from
Publish to MediaWiki

3.5

3.5 | 3 ratings Rate this file 3 Downloads (last 30 days) File Size: 2.38 KB File ID: #23856
image thumbnail

Publish to MediaWiki

by Matthew Simoneau

 

21 Apr 2009

A stylesheet to make MATLAB publishing produce MediaWiki markup as an output.

| Watch this File

File Information
Description

This stylesheet converts from publishing's intermediate XML format to MediaWiki-compatible markup. The output is ready for cut-and-paste into Wikipedia or other sites running the MediaWiki software.

This implementation isn't 100% complete.

Sample usage:

>> opts = [];
>> opts.format = 'xml';
>> opts.stylesheet = 'C:\Work\mediawiki.xsl';
>> tdir = tempname;
>> opts.outputDir = tdir;
>> f = publish('sparsity',opts);
>> disp(tdir)
>> dir(tdir)
>> edit(f)

You can also set these options in a publish configurations to make it available directly from the Editor.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
22 Apr 2009 us  
22 Apr 2009 us

works very well; BUT there's a small type in the sample usage:
mediawiki.xsl
should read
mediawiki.xml
just a thought
urs

23 Apr 2009 Matthew Simoneau

urs, I'm not sure where you mean. I think it should be mediawiki.xsl everywhere.

23 Apr 2009 joshua vogelstein

this works pretty great for me, but i get things like:

<source lang="matlab"> load('west0479.mat') A = west0479; S = A * A' + speye(size(A)); pct = 100 / prod(size(A));
clf; spy(S), title('A Sparse Symmetric Matrix') nz = nnz(S); xlabel(sprintf('nonzeros=%d (%.3f%%)',nz,nz*pct)); </source>

is it possible that i set something up incorrectly?

24 Apr 2009 us

matthew, correct...
however, your file's extension is XML...
urs

27 Apr 2009 Matthew Simoneau

joshua, is it the "<source>" that you're asking about? That's markup for the syntax highlighting extension. It's installed on Wikipedia and most other installations. http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi

us, I checked again and the file is xsl on the File Exchange. it's possible your browser or OS is renaming the file when you download it.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
publish Matthew Simoneau 22 Apr 2009 09:10:32
mediawiki Matthew Simoneau 22 Apr 2009 09:10:32
wiki Matthew Simoneau 22 Apr 2009 09:10:32
output Matthew Simoneau 22 Apr 2009 09:10:32
export Matthew Simoneau 22 Apr 2009 09:10:32
markup Matthew Simoneau 22 Apr 2009 09:10:32
wikipedia Matthew Simoneau 22 Apr 2009 09:10:32

Contact us at files@mathworks.com