anonimitoraf / exercism.el

Emacs integration for https://exercism.org
GNU General Public License v3.0
32 stars 3 forks source link

MELPA

Preamble

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!

Prerequisites

Download the exercism CLI by following the official guide.

Quick Start

Configure

Get your API token and pop it into the prompt. This is a once-off configuration (unless you reset your token).

https://user-images.githubusercontent.com/15933322/190892930-2ff737ae-f672-4688-ab0d-7f655508da77.mov

Path Configuration

Before customizing exercism--workspace, be sure to change it on the CLI first:

exercism -w "path/to/dir"

no-littering

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

https://user-images.githubusercontent.com/15933322/190892892-02f53f4c-07f8-4d85-ad2c-19ff1351c37a.mp4

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.

https://user-images.githubusercontent.com/15933322/190892957-b7ae8c3c-40e2-4a81-b737-3e504d18fed8.mp4

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.

https://user-images.githubusercontent.com/15933322/190892960-8b82c3b8-55f5-4eea-8091-293569f9231a.mp4

Known Limitations

Contributing