Skip to content

hoonti06/jekyll-code-block-linenos

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages