Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Teachable.

Syntax highlighting – Markdown

Summary

Markdown:

```javascript
function doSomething() {
  // Write code here
}
```

Details

To add syntax highlighting to your code snippets in Markdown, add the name of the language right after the first 3 backticks.

Some languages may have more than one way of adding syntax highlighting. For example, you can also use js for JavaScript code.

```js
function doSomething() {
  // Write code here
}
```

Demo

Click here to see an example of what this code looks like when rendered on GitHub. (Click the Raw button to see the actual Markdown code.)

Exercises

First, recreate the code snippet from the Summary section in your Markdown file. Then try customizing the text.

References

Mastering Markdown on GitHub

Lesson tags: Free Lesson
Back to: Markdown Reference > GitHub Markdown