This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
To run serverless functions locally
The site is deployed to Netlify, under an open source plan.
Upon push or merge to develop
, a live deploy preview is created via GitHub actions.
Upon push or merge to master
, the site is built and a production deployment is made automatically via Netlify.
There are two approaches to rendering LaTeX formulas, which configured in .env
files at the root of the repository:
- Server-side, enabled if
REACT_APP_SVG_RENDERING=server
. Images are rendered by the serverless functionrender-math-svg.js
, which converts LaTeX to SVG. - Client-side, enabled if
REACT_APP_SVG_RENDERING=client
. Images are Base64 encoded and the entire application can be hosted as a static website without serverless functions.
Use server-side rendering if there's a need to paste content from the editor to another website e.g. Moodle. Moodle and other tools may not allow Base64 encoded (client-side) images and require images to be returned from a url e.g <img src="https://editori.example.com/math.svg?latex=xyz">
.
Use client-side rendering to save on the costs of running serverless functions and for simple deployment of a static website.
Note:
/math.svg
is the required route for server-side formula rendering as this is used internally bymakeRichText
. A redirect innetlify.toml
sends requests from/math.svg
to the serverless function render-math-svg.js.
Answers are stored in a global zustand
store to allow access from outside React components and are persisted to local storage. See src/store/answers.js
.
- Read our Code of Conduct
- If you spot something new, open an issue to start a discussion
- Fork the repo when you're ready to make a change
- Make your updates!
- Open a pull request and wait for a review
- Your PR is merged!