Skip to content

Conversation

@bkardell
Copy link

So this needs a bit more, but realistically, if you have this branch checked out and a modern version of nodejs installed you should be able to type (from the root of the directory)

npm install

and once that is done, switch to src and write a test.js which is as simple as

const { convertUnicodeToMathML } = require('../src/index.js');
const result = convertUnicodeToMathML('x^2');
console.log(result)

(from the src directory) running node test that should yield a logged MathML string. If we finish this, we register a build with npm and it makes it so that people can just add a dependency in their package.json to get support.

IF this works, for you, aside from the bits about where those files should go, there are some other things to cleanup which I haven't committed in order to focus what we're looking at. I also have changes to ../playground/index.html (to ) and ../utils/generate-parser.html (to put the format to commonjs)

Arguably we should relocate build.js to the root and parser.js to /lib or something but the idea here is that build actually generates the parser so that it can be used, index and utils expose modules
@bkardell bkardell changed the title Bkardell patch 1 modularizing for npm etc Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant