A simple Electron application to show code demos in presentations, developed mainly for the "Basic Reservoir Engineering with OpenFOAM" Course.
- Install Node LTS
- Clone this repository
- [Optional but recommended] Install the Iosevka font
cd codedemoapp
npm install
to install the application's dependenciesnpm start
to start the application
Press Ctrl-F to start searching for code snippets.
You can populate/update the code database from the commandline with
(After running npm install
of course):
rm database.json
node_modules/electron/cli.js app.js --update-db
The app doesn't do much:
- Maintains a JSON database of code snippet titles, descriptions and paths to YAML files
- Usues Fuse.js to search through the descriptions and titles; Select the best match
- Reads in the selected YAML file. See
code/syntax/example.yml
for example. - Uses
@glorious/demo
to instantiate terminals and editor windows according to the YAML file.
That's it ...
One last note, this is still under development; Please open an issue if you judge something is wrong!
Code snippets are stored as YAML files under code/
directory. Copy code/syntax/example.yml
and
start editing it.
- Supported code languages are those of PrismJS
ls node_modules/prismjs/components/prism-*.js
gives a list of such languages
- The code theme is a combination of the selected PrismJS theme and
css/styles
- The default PrismJS theme is "VS"
- With some overwrites in
css/styles