Clean Math Expressions First
Output Readme Download Replit Sel. & Copy Full

About

This repl cleans up many math expressions to make them simpler to postfix. Read this blog post for more information.

To view this on TripleLog, click here

Google Sheets

The updateSheet.js file reads some data from a Google Sheet. You will need to add authentication to run this update. If you don't want/need to do this, then it is not necessary. Create the API account if you haven't already and add a service worker account key. View the google-spreadsheet documentation to get started. Read my blog post about how to convert a Google Sheet to an HTML table.

HTML

The index.html is a generated file so if you change it then your changes will be overwritten. Edit the template.html file. The HTML part is a very simple input/output. Then there is a lot of inline JS. You can improve the HTML to do more if you have ideas.

JavaScript

The JavaScript is included in the template.html file and performs a couple of trie search and replaces. You can generate a separate JS file if you wish.

A trie is created to replace some strings that have important whitespace. Then whitespace is replaced. Then another trie replaces lots more strings. Changing the data maps either by using different spreadsheets or by changing the data files will change the replacements.

NodeJS Server

The index.js file reads the 2 json files and inserts them into the template file. Then the index.html is generated.

The generated (index.html) file is a static file so it can be served by your preferred method of serving static files.