GithubHelp home page GithubHelp logo

standardgalactic / classroom-rocket-scientist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chrisnorth/classroom-rocket-scientist

0.0 2.0 0.0 62.16 MB

Become a classroom rocket scientist

Home Page: http://chrisnorth.github.io/classroom-rocket-scientist/

Python 0.86% HTML 61.30% CSS 24.63% JavaScript 11.67% Perl 1.34% Shell 0.11% Batchfile 0.09%

classroom-rocket-scientist's Introduction

Classroom rocket scientist

Become a classroom rocket scientist.

Updating

On previous projects we'd allowed for different languages and levels. To make it work off-line, we'd rather lazily used AJAX to load much of the content that changed. It is better to have the content in the page so this time we've taken a different approach. The configuration is still in json but language is stored in yaml which should make is easier to read for those who end up translating. Some perl scripts build the final json and use HTML templates containing pseudo SSI code to re-build the pages.

To change numerical values (masses, costs etc.), edit 'config/options_beginner.json' (and similar for intermediate and advanced). Those files contain links to text contained within %%. To change the text, edit config/en_beginner.yaml etc. Note that The config/en_beginner_options.json files are overwritten by the perl script, so any edits you make will be lost.

To update everything (json, html etc.), run the shell script:

./regenerate.sh

Alternatively, you can update individual parts.

HTML

The HTML is created from the templates directory so edit the files in there not the live files. The templates contain SSI-like commands as these are comments so don't display in a browser if they remain unparsed. The perl script reads the yaml and json files and uses these to process the templates. Variables, includes, and a basic for loop have been implemented as these are enough to get the job done. An HTML page is created for the front page and each of the three levels. Potentially, a version of each of these could be created for each language that exists; the filename could have the language code appended (not currently implemented).

To regenerate the static HTML there is a perl script:

perl config/template.pl -mode beginner templates/index.html index.html

perl config/template.pl -mode beginner templates/level.html beginner.html
perl config/template.pl -mode intermediate templates/level.html intermediate.html
perl config/template.pl -mode advanced templates/level.html advanced.html

CSS

We use SASS for the CSS as this gives re-useable variables and makes it easier to add all the browser prefixes. So, any changes to the CSS should be done in the css/style.scss file and the files referenced from that (e.g. in the tests/ directory for satellites and orbits). The main css/style.css file can be regenerated using:

sass css/style.scss css/style.css

JSON

The json files are created from the language files and a template for each level.

perl config/config.pl

classroom-rocket-scientist's People

Contributors

slowe avatar chrisnorth avatar thetrashfactory avatar emmaalex avatar brychanjames avatar

Watchers

James Cloos avatar  avatar

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.