1.0.0 • Published 5 years ago

gulp-mathjaxify v1.0.0

Weekly downloads
7
License
GPL-3.0
Repository
github
Last release
5 years ago

gulp-mathjaxify

A simple gulp plugin to statically render your math expressions in larger documents using gulp. Specifically, a wrapper around mathjax-node-page.

Build Status

Installation

Install from the npm registry by entering the following command into the shell.

npm install gulp-mathjaxify

Usage

Import mathjaxify from gulp-mathjaxify and then call mathjaxify in a gulp pipe with the appropriate mathjax-node-page options.

// gulpfile.js

const { src, dest } = require("gulp");
const { mathjaxify } = require("gulp-mathjaxify");

// Use mathjax-node-page options
// Refer to https://www.npmjs.com/package/mathjax-node-page#usage

// Render equations as html
src("./src/*.html")
    .pipe(mathjaxify({ output: "html" }))
    .pipe(dest("./dist/"))

// Render equations as svg
// Interpret single-dollar expressions as inline expressions
src("./src/*.html")
    .pipe(mathjaxify({ output: "svg", singleDollars: true }))
    .pipe(dest("./dist/"))