This repository is a collection of Markdown files where we store the solutions for Type Challenges with explanations and comments.
The structure here is pretty simple.
In the root, we have folders that are split by language codes.
In each folder there is must be a single Markdown file per challenge, named as it is named in Type Challenges repository <level>-<challenge>.md
.
The Markdown file itself must comprise the following content:
---
id: <CHALLENGE_ID>
title: <CHALLENGE_TITLE>
lang: <CHALLENGE_LANGUAGE>
level: <CHALLENGE_LEVEL>
tags: <CHALLENGE_TAGS>
---
## Challenge
<CHALLENGE_DESCRIPTION_FROM_TYPE_CHALLENGES>
## Solution
<CHALLENGE_SOLUTION_WITH_COMMENTS>
## References
<CHALLENGE_REFERENCES_TO_READ_MORE>
I use Jekyll to build the site and deploy to GitHub Pages. So if you want to experiment with the repository and serve the content locally, make sure that you have installed the dependencies and call the serve recipe:
bundle install
make serve
If you want to run the whole pipeline with tests and linter, just call make:
make
You can sync up with the original repository type-challenges
to know what solution is missing in the repository.
To do that, there is a script called sync_challenges.rb
in _scripts
folder.
Calling that script via ruby
will print all the challenges that are exists in type-challenges
repo but are missing in ours.
bundle exec ruby _scripts/sync_challenges.rb
E.g. it prints out en/easy-awaited.md
.
In that case, it means that there is a challenge easy-awaited
, but you don’t have a solution for it in English.
Also, you can specify an optional language to filter out. For instance, if you want to sync only the solutions that are written in English, you can pass it as an argument.
bundle exec ruby _scripts/sync_challenges.rb en