@sonnetjs/mathml
v0.0.12
Published
sonnetjs/mathml is a library for creating MathML elements in JavaScript. It provides a set of functions to create MathML elements and provides chainable methods to set attributes, properties, and children.
Downloads
75
Maintainers
Readme
sonnetjs/mathml
sonnetjs/mathml is a library for creating MathML elements in JavaScript. It provides a set of functions to create MathML elements and provides chainable methods to set attributes, properties, and children.
Features
- Create MathML elements using functions.
- Set attributes and properties of MathML elements using chainable methods.
- Add children to MathML elements using children method.
Usage
- Run the following command to create a new SonnetJS project.
npx create-sonnet-app@latest
- Change directory to the newly created project.
cd [my-sonnet-app]
- Install the dependencies
npm i
- Install sonnetjs/mathml
npm i @sonnetjs/mathml
- Start the development server
npm run dev
Documentation
MathML Elements
You can create MathML elements using functions.
import { math, mrow, mi, mo } from '@sonnetjs/mathml';
const element = math()
.children(
mrow()
.children(
mi().innerText('x').get(),
mo().innerText('+').get(),
mi().innerText('y').get(),
)
.get(),
)
.get();
License
sonnetjs/mathml is licensed under the MIT license.