Coder Social home page Coder Social logo

foamscience / codedemoapp Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 316 KB

A simple Electron App to show OpenFOAM code snippets (OR any other code snippets for that matter) for presentations

JavaScript 66.14% CSS 18.80% HTML 15.06%
yaml electron-app code-demo presentation presentation-slides openfoam foam-extend

codedemoapp's Introduction

CodeShoApp

A simple Electron application to show code demos in presentations, developed mainly for the "Basic Reservoir Engineering with OpenFOAM" Course.

Getting started

  • Install Node LTS
  • Clone this repository
  • [Optional but recommended] Install the Iosevka font
  • cd codedemoapp
  • npm install to install the application's dependencies
  • npm 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

Underline Tech

The app doesn't do much:

  1. Maintains a JSON database of code snippet titles, descriptions and paths to YAML files
  2. Usues Fuse.js to search through the descriptions and titles; Select the best match
  3. Reads in the selected YAML file. See code/syntax/example.yml for example.
  4. 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!

Adding your own snippets

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

Theming and syntax highlighting

  • 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.