{"id":19501140,"url":"https://github.com/gitbookio/plugin-exercises","last_synced_at":"2025-10-19T15:02:21.637Z","repository":{"id":19568949,"uuid":"22818196","full_name":"GitbookIO/plugin-exercises","owner":"GitbookIO","description":"Interactive exercices in a gitbook","archived":false,"fork":false,"pushed_at":"2018-03-28T12:18:38.000Z","size":1049,"stargazers_count":56,"open_issues_count":8,"forks_count":29,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-25T06:39:20.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://plugins.gitbook.com/plugin/exercises","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GitbookIO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-10T20:41:56.000Z","updated_at":"2023-04-14T13:29:07.000Z","dependencies_parsed_at":"2022-08-23T19:00:37.190Z","dependency_job_id":null,"html_url":"https://github.com/GitbookIO/plugin-exercises","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fplugin-exercises","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fplugin-exercises/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fplugin-exercises/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitbookIO%2Fplugin-exercises/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitbookIO","download_url":"https://codeload.github.com/GitbookIO/plugin-exercises/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250912660,"owners_count":21506865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T22:11:37.788Z","updated_at":"2025-10-19T15:02:21.557Z","avatar_url":"https://github.com/GitbookIO.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Interactive exercises in a gitbook\n==============\n\nWith this plugin, a book can contain interactive exercises (currently only in Javascript). An exercise is a code challenge provided to the reader, who is given a code editor to write a solution which is checked against the book author's validation code.\n\n## How to use it?\n\nTo use the exercises plugin in your Gitbook project, add the `exercises` plugin to the `book.json` file, then install plugins using `gitbook install`.\n\n```\n{\n    \"plugins\": [\"exercises\"]\n}\n```\n\n## Exercises format\n\nAn exercise is defined by 4 simple parts:\n\n* Exercise **Message**/Goals (in markdown/text)\n* **Initial** code to show to the user, providing a starting point\n* **Solution** code, being a correct solution to the exercise\n* **Validation** code that tests the correctness of the user's input\n* **Context** (optional) code evaluated before executing the user's solution\n\n```\n{% exercise %}\nDefine a variable `x` equal to 10.\n\n{% initial %}\nvar x =\n\n{% solution %}\nvar x = 10;\n\n{% validation %}\nassert(x == 10);\n\n{% context %}\n// This is context code available everywhere\n// The user will be able to evaluate `exposedVar`\nvar exposedVar = 3;\n// ... or call `exposedFunction`\nfunction exposedFunction {\n    return 3;\n}\n{% endexercise %}\n```\n\n**The old format (`gitbook \u003c 2.0.0`) is no longer supported.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbookio%2Fplugin-exercises","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitbookio%2Fplugin-exercises","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbookio%2Fplugin-exercises/lists"}