1
- # highlightjs-line-numbers.js [ ![ version ] ( http ://img.shields.io/badge/release-v2.2.0-brightgreen. svg?style=flat )] ( https://github. com/wcoder /highlightjs-line-numbers.js/archive/master.zip )
1
+ # highlightjs-line-numbers.js [ ![ npm ] ( https ://img.shields.io/npm/v/highlightjs-line-numbers.js. svg)] ( https://www.npmjs. com/package /highlightjs-line-numbers.js ) ![ npm ] ( https://img.shields.io/npm/dw/highlightjs-line-numbers.js.svg )
2
2
3
3
Highlight.js line numbers plugin.
4
4
@@ -18,7 +18,7 @@ npm install highlightjs-line-numbers.js
18
18
19
19
#### Getting the library from CDN
20
20
``` html
21
- <script src =" //cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.2 .0/highlightjs-line-numbers.min.js" ></script >
21
+ <script src =" //cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.3 .0/highlightjs-line-numbers.min.js" ></script >
22
22
```
23
23
24
24
## Usage
@@ -40,45 +40,45 @@ hljs.initLineNumbersOnLoad();
40
40
Here’s an equivalent way to calling ` initLineNumbersOnLoad ` using jQuery:
41
41
``` js
42
42
$ (document ).ready (function () {
43
- $ (' code.hljs' ).each (function (i , block ) {
44
- hljs .lineNumbersBlock (block);
45
- });
43
+ $ (' code.hljs' ).each (function (i , block ) {
44
+ hljs .lineNumbersBlock (block);
45
+ });
46
46
});
47
47
```
48
48
49
49
If your needs cool style, add styles by taste:
50
50
``` css
51
51
/* for block of numbers */
52
52
td .hljs-ln-numbers {
53
- -webkit-touch-callout : none ;
54
- -webkit-user-select : none ;
55
- -khtml-user-select : none ;
56
- -moz-user-select : none ;
57
- -ms-user-select : none ;
58
- user-select : none ;
59
-
60
- text-align : center ;
61
- color : #ccc ;
62
- border-right : 1px solid #CCC ;
63
- vertical-align : top ;
64
- padding-right : 5px ;
65
-
66
- /* your custom style here */
53
+ -webkit-touch-callout : none ;
54
+ -webkit-user-select : none ;
55
+ -khtml-user-select : none ;
56
+ -moz-user-select : none ;
57
+ -ms-user-select : none ;
58
+ user-select : none ;
59
+
60
+ text-align : center ;
61
+ color : #ccc ;
62
+ border-right : 1px solid #CCC ;
63
+ vertical-align : top ;
64
+ padding-right : 5px ;
65
+
66
+ /* your custom style here */
67
67
}
68
68
69
69
/* for block of code */
70
70
td .hljs-ln-code {
71
- padding-left : 10px ;
71
+ padding-left : 10px ;
72
72
}
73
73
```
74
74
75
75
## Options
76
76
77
77
After version 2.1 plugin has optional parameter ` options ` - for custom setup.
78
78
79
- name | type | default value | description
80
- -----|------|---------------|------------
81
- singleLine | boolean | false | enable plugin for code block with one line
79
+ name | type | default value | description
80
+ ----------- |--------- |---------------|----------- ------------
81
+ singleLine | boolean | false | enable plugin for code block with one line
82
82
83
83
#### Examples of using
84
84
@@ -93,4 +93,4 @@ hljs.lineNumbersBlock(myCodeBlock, myOptions);
93
93
```
94
94
95
95
---
96
- © ; 2017 Yauheni Pakala | MIT License
96
+ © ; 2018 Yauheni Pakala | MIT License
0 commit comments