jekyll-code-block-linenos
'jekyll-code-block-linenos' can replace triple backticks code block including keyword linenos
in markdown(Eg. ```cpp linenos
) with highlight tag including linenos(Eg. {% hightlight cpp linenos %}
) before rendering markdown to html.
'jekyll-code-block-linenos' uses Jekyll Hook.
'jekyll-code-block-linenos' is available only when using gem rouge
.
Requirements
- Jekyll, version
4.0
or higher -
rouge, version
3.0
or higher
Installation
Run bundle install
after adding the gem to your Jekyll Gemfile.
gem "jekyll-code-block-linenos"
Configuration
Add the gem to the Jekyll _config.yml
.
plugin:
- jekyll-code-block-linenos
Usage
Write ```{language} linenos
in markdown as follows.
```java linenos
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
```
Then, the rendered html result looks like this.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request