md2adapt is a command-line tool that converts Markdown (.md) files into the Adapt learning content format.
Before running md2adapt, make sure you have the following software installed:
- Python 3.7+
The tool is written in Python. - pip
For managing Python packages. - (Optional) Adapt Authoring Tool
For importing output into a full Adapt deployment. - Existing Adapt Course
An Adapt course should already be set up before running the script (although the necessary JSON files will be generated). You can create a course using the Adapt CLI.
Example:
mkdir -p /path/to/your/adapt-couse cd /path/to/your/adapt-couse npm install -g adapt-cli adapt create course
Clone this repository and install dependencies:
git clone https://github.com/com-digi-s/Markdown2Adapt.git
cd Markdown2Adapt
pip install -r requirements.txtTo convert a Markdown file to an Adapt course format, use the following command:
python md2adapt.py --out /path/to/your/adapt-course/src/course/en /path/to/your/markdown-template.mdTo preview the generated JSON files, simply run the script and specify any output directory you prefer.
python md2adapt.py --out ./output /path/to/your/markdown-template.mdThe given Markdown sample will look like this in Adapt:

### Component mcq title - How many answers are right? (with feeedback keyword)
* [x] 1
* [ ] 2
* [ ] 3
Feedback: Only one answer is right.Component chunks can include metadata lines in key: value syntax. These lines
are removed from the rendered content and used to control parsing and the
generated component JSON. Their position inside the component does not matter.
Example:
### Match the items
- Benutzerrechte
_isRandom: False
- [x] Schlüssel und Zutrittsregeln
- [ ] Das Gebäude
- Administratorrechte
_isRandomQuestionOrder: True
- [x] Verwaltung und Freigaben
- [ ] Das GebäudeSupported values include True/False, numbers, quoted strings, arrays, and
objects. Underscore-prefixed Adapt options such as _isRandom use the same
key: value syntax.
Standard Markdown images are supported. To set a specific display width, append
|<width> inside the alt text brackets:


The number alone defaults to pixels (300 → 300px). Supported units: px,
%, em, rem. The |width part is stripped from the visible caption.
Component types are inferred from the remaining syntax after metadata lines are removed:
- MCQ: flat checklist answers like
* [x] ... - Slider:
scale:plus optionallabelStart:/labelEnd: - Matching: top-level
- Questionitems with nested- [x] Answeroptions - Reflection:
placeholder:line - Accordion: repeated standalone
**Title**item headings
Explicit type: matching, type: reflection, type: accordion, type: mcq,
and type: slider still work, but they are optional when the syntax is already
distinctive.

