File Exchange syntax highlighter
Userscripts let the user to customize the appearance of web pages by JavaScript.
This script is based on the MATLAB Highlighter and lets the users to view syntax-highlighted .m files in the File Exchange section. Of course you can download the .m files, and open them in the MATLAB editor, but this syntax highlighter provides a convenient way to get colored code just in your browser if you want to have a short look at them.
The tool was tested in Firefox and Chrome: Firefox users can use this script by the Greasemonkey userscript handler, while Chrome users can activate it by using the Tampermonkey extension. See more details for other browsers below.
Any comments, requests are welcome.
Installation instructions
Firefox
- Install the Greasemonkey addon from https://addons.mozilla.org/hu/firefox/addon/greasemonkey/
- For manual install: download the file and add it by the New script... option.
- For automatic install:
- Click on http://matlabtricks.com/highlighter/matlab-highlighter-0.98.user.js
- Greasemonkey extension will pop-up a window to help installing the script
Chrome
- Install the Tampermonkey addon from https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo
- For manual install: download the file and add it by the Add a new script... option.
- For automatic install:
- Click on http://matlabtricks.com/highlighter/matlab-highlighter-0.98.user.js
- Tampermonkey extension will open a page to help installing the script
Opera
- Opera supports user scripts natively, but you have to install the script manually.
- More information: http://www.opera.com/docs/userjs/using/#whatcando
IE
- It seems hard to use userscripts under IE, but it may be possible... More information:
- http://wiki.greasespot.net/Cross-browser_userscripting#Internet_Explorer
- http://stackoverflow.com/questions/18305943/how-to-make-this-userscript-run-on-ie10
Safari
- I have found the following pages describing how to run userscripts on Safari:
- http://wiki.greasespot.net/Cross-browser_userscripting#Safari
- http://apple.stackexchange.com/questions/6953/are-there-greasemonkey-scripts-for-safari
Enjoy the colorful source codes in the File Exchange section :)
Cite As
Zoltan Fegyver (2025). File Exchange syntax highlighter (https://www.mathworks.com/matlabcentral/fileexchange/48047-file-exchange-syntax-highlighter), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.