3.5

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

Publish to MediaWiki

by Matthew Simoneau

 

21 Apr 2009

Code covered by BSD License  

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

Download Now | 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)
Zip File Content  
Other Files license.txt,
mediawiki.xsl
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
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com