Exercism is a great tool for learning new languages or diving deeper into familiar ones!
It offers not just a nice web editor but also a CLI if you want to use your local editor of choice. This package aims to streamline the latter, via Emacs!
Download the exercism
CLI by following the official guide.
- Install - it's available on Melpa!
- Load
exercism
via(require 'exercism)
or(use-package exercism)
or equivalent - Invoke the command
exercism
. It will popup a transient menu (similar to our belovedmagit
!)
Get your API token and pop it into the prompt. This is a once-off configuration (unless you reset your token).
configure.mov
Before customizing exercism--workspace
, be sure to change it on the CLI first:
exercism -w "path/to/dir"
Users of this package can "theme" the directory of this package rather simply:
(setq (exercism--workspace (no-littering-expand-var-file-name "exercism/")))
This sets the workspace to the var directory inside your emacs folder.
- Choose the track that you want to do exercises for.
- This might take a few minutes the first time because it "initializes" the track locally. Subsequent invocations will be instant.
set-track.mp4
Time to get into it! Note that some exercises are actually still locked, yet "select-able" (see the "Known Limitations" section).
Note that you need to have a network connection (since this package needs to query the exercism API). If you need to work offline,
pre-download all the exercises beforehand (see Download all unlocked exercises
).
If you want to do all the exercises locally, you can download them all. Note that this only includes exercises unlocked for you.
If you are working offline and have downloaded exercises previously, you can open one of those.
Run tests! You can see the results in the *compilation*
buffer.
(Only for CLI version 3.2.0 onwards, (run exercism-cli-version
to check))
Submits the current directory as a solution. Note that to mark the exercise as "completed", you'll have to do it via the web app.
submit.mp4
Similar to Submit
but automatically opens the exercise in the browser after submission. So if you want to mark your solution as "complete", you'd probably want to use this.
submit-then-open-in-browser.mp4
- Registering yourself to a track isn't currently supported. You'll have to do this via their web app, sorry!
- The exercises list that you choose from, also includes "not yet unlocked" ones. This is due to the the fact that the CLI doesn't support listing out exercises.
- All PRs, suggestions, complaints and anything in between are welcome!