onyx-platform / learn-onyx

Learn Onyx with an interactive workshop.
Eclipse Public License 1.0
77 stars 41 forks source link

Onyx Workshop

These are the material needed to conduct the Onyx workshop. All dependencies are included, no external set up beyond the JVM and Leiningen are needed. Please read all the instructions before beginning!

Things you need to know

How to work on a challenge

  1. Read the How to Start documentation, listed below, to run the environment sanity check.
  2. Open the cheat sheet at src/workshop/cheat_sheet.clj for your own reference.
  3. Open the test file in test/ for the challenge. Read the comments.
  4. Examine the input and expected output.
  5. Run the test, watch it fail. If you aren't using something like Cider or nrepl, you can run lein repl, and invoke the appropriate test var. Run (reset) to hot reload your code.
  6. Open the corresponding challenge source file in src/ for the test.
  7. Locate the <<< BEGIN FILL ME IN >>> and <<< END FILL ME IN >>>.
  8. Fix the source file with the appropriate changes.
  9. Run the test file and pass the test. Refer to Onyx's documentation (links below) and the answers branch as needed. I recommend running the tests in a repl to avoid restarting the JVM between test runs. Starting and stopping the Onyx environment only takes about two seconds, so you can iterate much faster. You may wish to call (reset) (clojure.test/run-tests 'workshop.jobs.challenge-0-0-test) via the repl to reset your environment before running each test.
  10. Load up the cheat sheet documentation guide: http://www.onyxplatform.org/docs/cheat-sheet/latest/

Remember that challenge 0 on every level is already working!

How to start

Begin the workshop with level 0, challenge 0. This is a test to ensure that your environment is sane and working. If all is well, you should see the following on standard out:

Starting Onyx development environment
==== Start job output ====
[{:sentence "Getting started with Onyx is easy"}
 {:sentence "This is a segment"}
 {:sentence "Segments are Clojure maps"}
 {:sentence "Sample inputs are easy to fabricate"}
 :done]
==== End job output ====
Stopping Onyx development environment

Once you see this, proceed to level 1, challenge 0. Run the test and observe the already-working example in challenge 0, then proceed to the next challenge. Once you finish all the challenges, proceed to the next level and repeat.

Reading

Each file has a moderate amount of comments to frame the discussion. Still, here are some links that will be helpful if you're approaching Onyx from scratch or need more information to help solve a challenge:

Gotchas

Guide

Below is the table of contents for the levels and challenges you'll be working through. Feel free to skip around.

License

Copyright © 2015 Distributed Masonry LLC

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.