Coder Social home page Coder Social logo

mathjax-grunt-cleaner's Introduction

MathJax-grunt-cleaner

A grunt file to reduce the footprint of a MathJax installation

  • Fetch a copy of MathJax wget https://github.com/mathjax/MathJax/archive/master.zip && unzip master.zip
  • copy & rename the template task
  • comment out the components you want to keep (perhaps counterintuitive)

See the comments in file for more details and caveats.

mathjax-grunt-cleaner's People

Contributors

kerryboyko avatar minrk avatar pkra 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mathjax-grunt-cleaner's Issues

Explain how this is supposed to be used

Please include a full example in README.md on how this is supposed to be used,
for someone not familiar with nodejs.

In the infinite time limit, I can figure it out, but basically listing set of the commands
required would be a big help. For example, the following is not the right thing to do
apparently:

git clone https://github.com/mathjax/MathJax-grunt-cleaner.git
cd MathJax-grunt-cleaner
wget https://github.com/mathjax/MathJax/archive/master.zip && unzip master.zip
npm install grunt --save-dev grunt-contrib-clean grunt-regex-replace
grunt MML_SVG_TeX

EDIT: apparently, it's the Mathjax source tree top level should be copied to the directory where Gruntfile.js is...

Update for MathJax 2.6

We need to update

  • add new renderers (CommonHTML, FastPreview, PlainSource)
  • add new extensions (AssistiveMML)

Anything else?

No support for running grunt locally

I'm in a work environment where I don't have sudo access to my development machine.

Can you add support for running grunt locally via an NPM script?

improve running the grunt file

From #5 (comment).

cloning mathjax to a subdir of this repo then running npm install && grunt template does nothing, because the relative paths are resolved relative to this repo instead of the mathjax root.

Hitting `ReferenceError: grunt is not defined` when attempting to run tasks from the Gruntfile

Hey -- I'm just trying out the grunt cleaner script and basically got stuck somewhere very elementary: running the Grunt script fails due to "ReferenceError: grunt is not defined". In my case I placed the Gruntfile.js and package.json to the root of the master checkout I made, then edited the Gruntfile to rename the "template" task as mpapp. The task doesn't get found if I then try running "grunt mpapp" or "grunt --gruntfile Gruntfile.js mpapp".

➜ MathJax git:(feature/equations-fix) ✗ grunt --gruntfile Gruntfile.js mpapp

Loading "Gruntfile.js" tasks...ERROR

>> ReferenceError: grunt is not defined

Warning: Task "mpapp" not found. Use --force to continue.

... and that appears to be due to >> ReferenceError: grunt is not defined which gets repeated with any Grunt command I try to run against this Gruntfile:

grunt --tasks will fail with the same "ReferenceError: grunt is not defined":

➜ MathJax git:(feature/equations-fix) ✗ grunt --tasks

Loading "Gruntfile.js" tasks...ERROR

>> ReferenceError: grunt is not defined



path.js:360

        throw new TypeError('Arguments to path.join must be strings');

              ^

TypeError: Arguments to path.join must be strings

    at path.js:360:15

    at Array.filter (native)

    at Object.exports.join (path.js:358:36)

    at Object.file.exists (/Users/mz2/Projects/Manuscripts/External/MathJax-checkout/MathJax/node_modules/grunt/lib/grunt/file.js:381:28)

    at task.loadTasks (/Users/mz2/Projects/Manuscripts/External/MathJax-checkout/MathJax/node_modules/grunt/lib/grunt/task.js:371:18)

    at Array.forEach (native)

    at Task.task.init (/Users/mz2/Projects/Manuscripts/External/MathJax-checkout/MathJax/node_modules/grunt/lib/grunt/task.js:457:33)

    at Object.grunt.tasks (/Users/mz2/Projects/Manuscripts/External/MathJax-checkout/MathJax/node_modules/grunt/lib/grunt.js:120:8)

    at Object.module.exports [as cli] (/Users/mz2/Projects/Manuscripts/External/MathJax-checkout/MathJax/node_modules/grunt/lib/grunt/cli.js:38:9)

    at Object.<anonymous> (/Users/mz2/.nvm-fish/v0.10.33/lib/node_modules/grunt-cli/bin/grunt:45:20)

Via Stack Overflow I can see that this is due to invalid Gruntfiles of different kinds. I wonder if I'm running with too recent a grunt-cli?

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.