Jisho is a web-based tool for generating custom searchable dictionaries for the TI-Nspire CX calculator series.
To use it, head to https://nhwn.github.io/jisho. There, you'll find a demo, usage instructions, and the dictionary creation tool itself.
Jisho is basically a glorified Lua script. The website is just a means of initializing said script with the user's terms and definitions.
The general build process of the script goes something like this:
- Get terms and definitions from the user via Quizlet HTML, JSON, or manual input through the editor.
- Inject the terms and definitions into the Lua script template (although it's really the whole program, sans the global tables).
- Embed the created script into a .tns file.
- Download the .tns file.
All of the magic happens in the js directory.
-
index.jshouses the main logic for running the website's editor. -
htmlToString.jsis a crudely browserified version of html-to-text. I literally spent an hour looking for a robust solution for converting something like3 < 4 <br> yesinto3 < 4 \n yes, and that package answered my prayers (I couldn't find any native browser solutions). It's necessary for parsing Quizlet HTML into its proper plaintext form, so its insane code bloat is a tradeoff I'm willing to make. -
saveAs.jsis a minified version of FileSaver.js. It's necessary for saving the .tns to the user's machine. Even though there are CDN versions available, I like having local copies of everything. Sue me ¯\_(ツ)_/¯. -
luna.jsis a minified, standalone version of Luna. It's necessary for generating the .tns file. -
jisho.luais the actual script that gets embedded in the .tns file. There are a bunch of other notes inside here regarding how the script works. -
minify-lua.shis a hackity hackity build script for generating the corresponding Javascript to put inindex.js. Note that it depends on luamin for minifyingjisho.lua.
Someday, I'll get a proper build system. Someday.