No release in over a year
'jekyll-code-block-linenos' can replace 3-backticks code-block including keyword 'linenos' in markdown with 'highlight tag including linenos' before rendering markdown to html.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 4.0, >= 4.0
~> 3.0, >= 3.0
 Project Readme

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT License.