Giter VIP home page Giter VIP logo

mathematica-source-highlighting's Introduction

Mathematica and Wolfram Language support for google-code-prettify

This is the official Mathematica and Wolfram Language code highlighter for Mathematica.stackexchange.com and the Wolfram Community.

To use it with your installation of google-code-prettify, you have to add the files (probably the minified versions) from the src folder into your code-pretty installation. The file lang-mma.min.js needs to go into the google-code-prettify/src folder and the prettify-mma.min.css needs to go into the styles folder. The difference between lang-mma.js and lang-mma.min.js is that the latter one is the minimized js-file. All other information can be found in the google-code-prettify wiki.

Note that I also compiled a Joomla extension which lets you easily install the whole highlighting engine on your Joomla based website.

The resources folder contains another file: mathematica-source-highlighter.user.js which is a browser userscript that was used to test the highlighter before it was officially installed at Stack Exchange. The JavaScript can be opened with Google Chrome and is then installed as a local extension. When you browse pages under http://stackoverflow.com/questions/ and have Mathematica code posted on the page its style is replaced and you should see nice code highlighting.

This user-script was written by Tim Stone and I only added the rules for the lexical scanner and colors which go along with the page colors of StackOverflow.

mathematica-source-highlighting's People

Contributors

balpha avatar carlqlange avatar halirutan avatar szhorvat avatar tms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mathematica-source-highlighting's Issues

Better Documentation?

I would like to contribute to your project with a restyling of your documentation. With a modern visual update, improved organization, and enriched content. I believe the documentation can become more user-friendly and accessible. I'm experienced in markdown and eager to collaborate on this improvement.

I aim to:

  1. restyle the documentation
  2. Create sections for the documentation
  3. Create other files and guide with separate information

Reduce size of resulting JS file

I note that the regular expression created by your Mathematica function is verbose (and likely inefficient to match against) since it is just a big disjunction of the individual tokens.

Obtaining minimal DFA from regular expressions is hard (i.e. has prohibitive cost) in general as the NFA -> DFA step may blow up the size of the automaton, but it may work out here.
Plus, it's not clear what size the regular expression we get by one of several algorithms will be.

Worth a try, anyway, I think.

Motivation: Mathematica highlighting has not been included into the SE-wide highlighting solution because of the size of the file(s). If they can be shrunk, chances are we'd be able to use Mathematica highlighting on other sites as well.

Show escape sequences within strings

This is a suggestion to add a minor feature.

It would be nice to be able to show escape sequences within strings.

This would really drive the point home that "\sin" is not the same thing as "\\sin" in Mathematica.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.