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.
exercism
via (require 'exercism)
or (use-package exercism)
or equivalentexercism
. It will popup a transient menu (similar to our beloved magit
!)
Configure
Get your API token and pop it into the prompt. This is a once-off configuration (unless you reset your token).
Path Configuration
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.
Set current track
Open an exercise
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
).
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.
Open a downloaded exercise
If you are working offline and have downloaded exercises previously, you can open one of those.
Run tests
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))
Submit
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 (then open in browser)
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.