asciimath / asciimathml

A new home for asciimathml
http://asciimath.org/
MIT License
957 stars 183 forks source link

Make ASCIIMathTeXImg.js UMD compatible and export as NodeJS package #118

Open meghprkh opened 3 years ago

meghprkh commented 3 years ago

This would allow us to publish and import it as a webpack/nodejs package.

This makes sure anyone using the scripts can continue doing so in the same way.

Note that I am using ASCIIMathTexImg.js here since it converts it to Latex, as anyone using it via webpack/nodejs would likely be using/can easily use Katex/MathJax for rendering latex to HTML or MathML

The UMD export pattern does look a bit ugly to directly add to the source code but is the easiest way forward without adding a build system and refactoring the code.

Note: the noMathRender variable wasn't being used, so I removed it.

meghprkh commented 3 years ago

Hi, did you get a chance to look at this :)

I would like to publish a remarkjs package for the same and if this is merged, it can depend on your package instead of depending on my fork :)

Also cc-ing @adius / @ad-si since he owns the npm package asciimath according to #7 . This does something like #51 but without duplicating code and keeping everything working as it is