/workout.js

a standard format for workouts

Primary LanguageJavaScript

A standard format and parser for crossfit workouts

(NOTE: still a work in progress but it so far works with all the hero wods.)

Here's an example of the crossfit workout Abbate from Crossfit.com:

Run 1 mile
155 pound Clean and jerk, 21 reps
Run 800 meters
155 pound Clean and jerk, 21 reps
Run 1 Mile

and the output of parsing the workout:

"abbate": [{
  "type": "rounds for time",
  "rounds": 1,
  "tasks": [{
    "type": "run",
    "distance": 1,
    "units": "miles"
  }, {
    "type": "clean and jerk",
    "reps": 21,
    "weight": 155,
    "units": "pounds"
  }, {
    "type": "run",
    "distance": 800,
    "units": "meters"
  }, {
    "type": "clean and jerk",
    "reps": 21,
    "weight": 155,
    "units": "pounds"
  }, {
    "type": "run",
    "distance": 1,
    "units": "miles"
  }]
}]