When you are creating Practice content in DataCamp's Teach Editor, you might unintentionally introduce YAML syntax errors. These errors will result in a failed build and will break the Preview mode.
This article describes how you can identify and fix those YAML syntax errors, so that you can get your content back on the tracks.
When you notice a failed build on the Course Overview page, it's worthwhile viewing the build error details.
You can access the build error details by clicking the Build status field. This is how the build error details look like:
In this example, the build error details indicate a syntax error in the
chapter3.md file. You can fix this by going to this file on the development branch of your GitHub repository.
Open the file, enter edit mode, and navigate to the lines indicated in the error message (👉
A challenge of challenges/chapter3.md: doesn't contain correct YAML syntax [duplicated mapping key at line 9, column 1: ^], lines 247-255 ).
In this example, the content creator specified
l1 instead of
l2 on line 252:
So, fix the error and save the file, which will trigger a new build in the Course Overview Page of the Teach Editor.
Each time you fix YAML syntax in GitHub, you need to manually synchronize the Teach Editor with GitHub when you open the editor. If you do not do this, you will introduce this syntax error again as it was still present in the Teach Editor.
The Teach Editor does not have a "sync with GitHub" button. Here's a short video on how to force the sync instead:
In summary, this is what you need to do:
- open the editor
- go to a random exercise and make a change (it doesn't matter what, you will revert it in the next step)
- this enables the
Savebutton; click on the arrow (
^) next to the
Savebutton and then click
Disregard unsaved changes
- wait for the Teach Editor to retrieve the most recent version of the content from GitHub
- start working on your content or just close the Editor
With this master class in build troubleshooting you are in the perfect position to get your content back on the tracks. So, go to the Teach Editor, fix those errors, and keep creating great Practice content!