/**
 * 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}`
    )
  }
)

/**
 * 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}`
    )
  }
)

--- 
+++ 
@@ -1,7 +1,7 @@
 /**
  * A script to generate `../shared/styles/mathjax.css`.
  *
- * Run using `npm run build:mathjax`.
+ * Run using `npm run generate:mathjax`.
  */
 
 import fs from 'fs'
docs(Comment): Update script reference to new name
