Skip to content

Hexlet/hexlet-exercise-kit

Repository files navigation

hexlet-exercise-kit

Main

This is a complete kit for teachers who want to create exercises on the Hexlet platform.

Requirements

  • Docker
  • Node.js
  • Make
  • Ubuntu, macOS or WSL (for Windows)

Setup

git clone git@github.com:Hexlet/hexlet-exercise-kit.git

cd hexlet-exercise-kit
make setup

If you have access to clone Hexlet repositories:

GITLAB_API_PRIVATE_TOKEN=<token>

# Adjust this value for faster or slower speed of repositories download
PARALLEL=4
make clone

# if your .ssh catalog has specific path:
make clone SSH_KEYS_PATH=/specific/path/to/your/.ssh

For pulling into cloned repos:

make rebase

Using hexlet linters

# install/update all hexlet linters
make update-hexlet-linters
# install/update one hexlet linter. For example, eslint
make update-hexlet-linter L=eslint

Run exercise

cd <path/to/exercise/catalog>
make build # build exercise container
make start # run exercise and listen port 80
make test # run tests
make lint-js # run linter
make lint-hexlet-js # check exercise with linter, as in production

For frontend exercise after make start open http://localhost:80 in your browser.

make stop # stopped container

Copy a course from Code-Basics to Hexlet

make copy-from-cb I=path-to-source O=path-to-destination

Run markdown linter

Add Makefile in the course directory:

include ../../../course.mk

and run:

make markdown-lint # view error list
make markdown-lint-fix # fix errors

New stuff

mkdir -p exercises/ru/course-<name>/<lesson-name>_exercise

Run LanguageTool

  • Install LanguageTool for your code editor. For example VS Code LanguageTool Linter
  • Set URL of your LanguageTool server. Defaults to localhost on port 8081
  • Run LanguageTool server make start-languagetool
  • Stop LanguageTool server make stop-languagetool

Troubleshooting

Unable to find image 'hexlet/gitlab-downloader:latest' locally
docker: Error response from daemon: pull access denied for hexlet/gitlab-downloader, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

Build downloader make build-downloader or see setup or fresh installation