/**
 * A script to generate `../shared/styles/mathjax.css`.
 *
 * Run using `npm run build:mathjax`.
 */

import fs from 'fs'
import MathJax from 'mathjax-node'
import path from 'path'

const dest = path.join(__dirname, '..', 'shared', 'styles', 'mathjax.css')

MathJax.typeset(
  {
    css: true
  },
  result => {
    const { errors, css } = result
    if (errors !== undefined) errors.map(err => console.error(err))
    fs.writeFileSync(
      dest,
      `/* Generated by ${path.basename(__filename)}. Do not edit. */\n\n${css}`
    )
  }
)

/**
 * A script to generate `../shared/styles/mathjax.css`.
 *
 * Run using `npm run generate:mathjax`.
 */

import fs from 'fs'
import MathJax from 'mathjax-node'
import path from 'path'

const dest = path.join(__dirname, '..', 'shared', 'styles', 'mathjax.css')

MathJax.typeset(
  {
    css: true
  },
  result => {
    const { errors, css } = result
    if (errors !== undefined) errors.map(err => console.error(err))
    fs.writeFileSync(
      dest,
      `/* Generated by ${path.basename(__filename)}. Do not edit. */\n\n${css}`
    )
  }
)

Update script reference to new name
docs(Comment): Update script reference to new name
