How to highlight the specific lines of code snippet present in markdown using jekyll?

Viewed 55

We are converting the md (markdown) files in to html files using Jekyll and hosting the html files in site.

I would like to highlight the specific line of the code snippet like below.

Microsoft Document

I have checked Microsoft source by inspecting. They done like this.

https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/updating-related-data-with-the-entity-framework-in-an-asp-net-mvc-application#customize-courses-pages

Microsoft Document Source

My MD file code snippet section will be like below.

{% highlight c# %}

int x = 5;
int y = 6;
int sum = x + y;
Console.WriteLine(sum);

{% endhighlight %}

For example , I have to highlight the line no 3 (int sum = x + y;) with yellow.

How to achieve this ?

0 Answers
Related