File tree Expand file tree Collapse file tree 1 file changed +29
-4
lines changed Expand file tree Collapse file tree 1 file changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,21 @@ allprojects {
16
16
```
17
17
Add the dependency:
18
18
``` gradle
19
- compile 'com.github.tiagohm:CodeView:0.1.1
19
+ compile 'com.github.tiagohm:CodeView:0.1.2
20
20
```
21
21
22
+ ## Highlighters
23
+ * [ HIGHLIGHT.JS] ( https://highlightjs.org/ )
24
+ 169 languages and 77 styles
25
+ * [ PRISM] ( http://prismjs.com/ )
26
+ 120 languages
27
+ * [ RAINBOW] ( https://craig.is/making/rainbows )
28
+ 19 languages
29
+
30
+ ## Other Links
31
+ * [ https://github.com/Blender3D/rainbow.linenumbers.js ] ( https://github.com/Blender3D/rainbow.linenumbers.js )
32
+ * [ https://github.com/wcoder/highlightjs-line-numbers.js/ ] ( https://github.com/wcoder/highlightjs-line-numbers.js/ )
33
+
22
34
## Usage
23
35
24
36
Add view to your layout:
@@ -31,7 +43,7 @@ Add view to your layout:
31
43
``` java
32
44
final CodeView cv = (CodeView )findViewById(R . id. code_view);
33
45
34
- // Using HighlightJs
46
+ // Using Highlight.js
35
47
cv. setSyntaxHighlighter(new HightlightJs ())
36
48
.setCode(" Your code" )
37
49
.setLanguage(HightlightJs . Languages . JAVA )
@@ -47,10 +59,23 @@ Add view to your layout:
47
59
.setShowLineNumber(true )
48
60
.setTextSize(12 )
49
61
.apply();
62
+ // Or using Rainbow
63
+ cv. setSyntaxHighlighter(new Rainbow ())
64
+ .setCode(" Your code" )
65
+ .setLanguage(Rainbow . Languages . JAVA )
66
+ .setTheme(Rainbow . Themes . GITHUB )
67
+ .setShowLineNumber(true )
68
+ .setTextSize(12 )
69
+ .apply();
50
70
```
51
-
71
+
72
+ Highlight.js
73
+ ![ ] ( https://raw.githubusercontent.com/tiagohm/CodeView/master/1.png )
74
+ Prism.js
52
75
![ ] ( https://raw.githubusercontent.com/tiagohm/CodeView/master/3.png )
53
-
76
+ Rainbow
77
+ ![ ] ( https://raw.githubusercontent.com/tiagohm/CodeView/master/2.png )
78
+
54
79
## LICENSE
55
80
Copyright 2016-2017 tiagohm
56
81
You can’t perform that action at this time.
0 commit comments