File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 3
3
# Highlights
4
4
Kotlin Multiplatform syntax highlighting engine
5
5
6
+ ## Installation
7
+ ``` sh
8
+ implementation(" dev.snipme:highlights:0.3.1-SNAPSHOT" )
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ To start, simply put any code snippet in the default builder
14
+
15
+ ``` kotlin
16
+ Highlights .default().apply {
17
+ setCode(" public class ExampleClass {}" )
18
+ // Keywords = [public, class], Marks = [{, }]
19
+ getCodeStructure()
20
+ // BoldHighlight, ColorHighlight
21
+ getHighlights()
22
+ }
23
+ ```
24
+
25
+ You can also set language, theme and phrase emphasis.
26
+ Language and theme has impact on the ColorHighlight and emphasis is represented by the BoldHighlight.
27
+
28
+ ``` kotlin
29
+ Highlights .Builder ()
30
+ .code(" public class ExampleClass {}" )
31
+ .theme(SyntaxThemes .monokai())
32
+ .language(SyntaxLanguage .JAVA )
33
+ .emphasis(PhraseLocation (13 , 25 )) // ExampleClass
34
+ .build()
35
+ .run {
36
+ getHighlights()
37
+ }
38
+ ```
39
+
40
+ ## Themes
41
+
42
+ TBD
43
+
6
44
License
7
45
=======
8
46
You can’t perform that action at this time.
0 commit comments