whatisgithub

What is plugin-exercises?

mostlyadequate/plugin-exercises — explained in plain English

Analysis updated 2026-07-21 · repo last pushed 2019-05-24

3JavaScriptAudience · writerComplexity · 2/5DormantSetup · moderate

In one sentence

A GitBook plugin that adds interactive coding exercises to online books, letting readers type code into an embedded editor and get instant feedback on whether their solution is correct.

Mindmap

mindmap
  root((repo))
    What it does
      Interactive code exercises
      Built-in code editor
      Instant answer checking
    Exercise parts
      Task message
      Starter code
      Reference solution
      Validation code
      Optional context
    Tech stack
      JavaScript
      GitBook
    Use cases
      Programming tutorials
      Interactive coding courses
    Audience
      Tutorial authors
      Course creators
    Limitations
      JavaScript only

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add interactive JavaScript exercises to a GitBook programming tutorial so readers can practice as they read.

USE CASE 2

Create a coding course where each chapter includes challenges with immediate feedback on correctness.

USE CASE 3

Build an online programming book where readers solve small coding problems without leaving the page.

What is it built with?

JavaScriptGitBook

How does it compare?

mostlyadequate/plugin-exercisesabhishek-kumar09/who-is-imposteramarjitjim/browserpilot
Stars333
LanguageJavaScriptJavaScriptJavaScript
Last pushed2019-05-242021-04-12
MaintenanceDormantDormant
Setup difficultymoderateeasymoderate
Complexity2/53/53/5
Audiencewritergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a GitBook project to be set up first, and exercises currently support JavaScript only.

So what is it?

This is a plugin for GitBook, a tool for creating online books, that lets you add interactive coding exercises directly into your book's pages. Instead of just reading about programming concepts, readers get a built-in code editor where they can type solutions to challenges and find out immediately whether their answer is correct. Each exercise has four parts. The author writes a message explaining the task, some starter code that appears in the editor for the reader to build on, a reference solution, and validation code that checks whether the reader's answer is right. There's also an optional fifth part called context, which runs behind the scenes and can set up variables or functions the reader's code needs to work with. When a reader submits their code, the validation logic runs against it and tells them if they solved it correctly. This would be useful for anyone writing a programming tutorial or course. For example, if you're writing a book teaching JavaScript basics, you could include an exercise asking the reader to create a variable equal to 10. They type their answer into the editor, and the plugin checks it on the spot rather than making them switch to a separate coding environment. The exercises currently support JavaScript only. The README doesn't go into detail about the GitBook platform itself, but the core idea is straightforward: turn a passive reading experience into a hands-on one where people practice what they learn as they go.

Copy-paste prompts

Prompt 1
Help me set up the gitbook-plugin-exercises plugin in my GitBook project and write my first interactive JavaScript exercise with a message, starter code, reference solution, and validation code.
Prompt 2
I want to add an exercise to my GitBook where the reader has to write a function that returns the sum of two numbers. Walk me through creating the exercise block with all required parts including context code.
Prompt 3
Show me how to use the optional context field in a gitbook-plugin-exercises exercise to pre-define variables and functions that the reader's code can use when solving the challenge.
Prompt 4
How do I configure the gitbook-plugin-exercises plugin in my book.json and what does a complete exercise block look like in Markdown?

Frequently asked questions

What is plugin-exercises?

A GitBook plugin that adds interactive coding exercises to online books, letting readers type code into an embedded editor and get instant feedback on whether their solution is correct.

What language is plugin-exercises written in?

Mainly JavaScript. The stack also includes JavaScript, GitBook.

Is plugin-exercises actively maintained?

Dormant — no commits in 2+ years (last push 2019-05-24).

How hard is plugin-exercises to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is plugin-exercises for?

Mainly writer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.