Welcome! Contributions are very welcomed. If you ever feel unsure, please do open an issue.
Preferably, features are developed in another branch or fork. After the feature is ready, a pull request to the main branch should be opened.
If the currently entered equation is /
then
flowchart TD
Rendered["<b>Rendered</b><br><div style='text-align: start'><pre><code><math><br> <mfrac><br> <br> <mrow><br> <mn>1</mn><br> <mo>+</mo><br> <msup><mi>x</mi><mn>2</mn></msup><br> </mrow><br> <br> <mi>⬚</mi><br> <br> </mfrac><br></math></code></pre></div>"]
CST["<b>Concrete Syntax Tree</b><br>(fraction (add ('1') (sup ('x') ('2'))) ()) "]
UserInput["<b>User inputs</b><br>the pressed <code>/</code> key"]
InputTree["<b>Input Tree</b><br> (row '1' '+' 'x' (sup '2') '/') "]
Cosmetics["<b>Cosmetics</b><br>extra annotations like text colors"]
UserInput -->|modify the| InputTree
InputTree -->|parsed into a| CST
CST -->|converted to MathML| Rendered
Cosmetics -->|used for rendering| Rendered
- Node 18 or greater. Don't install Chocolatey.
- A code editor (see below)
- Fork the repository
- Clone your fork
npm install
npm run dev
I recommend using Visual Studio Code with
- Rust Analyzer for Rust
- Prettier Extension to format your files
- Settings → Format On Save → Enable (
"editor.formatOnSave": true,
)- If you are using autosave: Settings → Autosave → On Focus Change (
"files.autoSave": "onFocusChange",
)
- If you are using autosave: Settings → Autosave → On Focus Change (
- (optional)Error Lens to see all the errors inline with the code
- (optional)TODO Highlight Extension
As for settings, I personally am a fan of those "inlay hints".
The most important ones are
- Typescript - Typesafe Javascript
- Rust - Safe and productive systems programming language
We are also using
- Vite - speedy development server and bundler
aftermath-core
is the self-contained Rust library that parses the math formulasrc/component/math-editor.ts
contains the web component for the mathematical editorsrc/core
has the aftermath-core parser bindingssrc/mathml
has the MathML rendering codesrc/mathml/parsing.ts
has the MathML parsing codesrc/rendering
has the non-renderer-specific rendering interfacessrc/utils
has a few utility functions that I sometimes wish were part of the Javascript standard library