You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+92-18Lines changed: 92 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,26 +8,26 @@ CodeView helps to show code content with syntax highlighting in native way.
8
8
## Description
9
9
CodeView contains 3 core parts to implement necessary logic:<br>
10
10
11
-
1. <b>CodeClassifier</b> is trying to define what language presented in code snippet. It built upon <ahref="https://github.com/ptnplanet/Java-Naive-Bayes-Classifier">Naive Bayes classifier</a>. There is no need to work with this class directly & you must just follow instructions below. (Experimental module, may not work properly!)<br>
11
+
1. <b>CodeClassifier</b> is trying to define what language presented in code snippet. It built upon [Naive Bayes classifier](https://github.com/ptnplanet/Java-Naive-Bayes-Classifier). There is no need to work with this class directly & you must just follow instructions below. (Experimental module, may not work properly!)<br>
12
12
13
-
2. For highlighting it uses <b>CodeHighlighter</b>, just highlights your code & returns formatted content. It based on Google Prettify and <ahref="https://github.com/twalcari/java-prettify">their fork</a>.<br>
13
+
2. For highlighting it uses <b>CodeHighlighter</b>, just highlights your code & returns formatted content. It based on [Google Prettify](https://github.com/google/code-prettify) and their Java implementation & [fork](https://github.com/google/code-prettify).<br>
14
14
15
-
3. <b>CodeView</b> & related adapter.<br>
15
+
3. <b>CodeView</b> & related abstract adapter to provide customization (see below).<br>
16
16
17
17
## Download
18
18
Add it in your root ```build.gradle``` at the end of repositories:
Here you must provide a map from code line numbers (started from 0) to list of line entities. It will be mapped by adapter to specified footer views.
150
+
<br>
151
+
152
+
See [Github diff](https://github.com/Softwee/codeview-android/blob/master/codeview/src/main/java/io/github/kbiakov/codeview/adapters/CodeWithDiffsAdapter.kt) as example of my "best practice" implementation.
153
+
94
154
## How it looks in app
95
155
See <ahref="https://github.com/Softwee/codeview-android/blob/master/example/src/main/java/io/github/kbiakov/codeviewexample/ListingsActivity.java">example</a>.<br>
Didn't found yours? Please, open issue to show your interest & I try to add this language in next releases.
103
165
166
+
## List of available themes
167
+
1. Default (simple light theme)
168
+
2. Solarized Light
169
+
3. Monokai
170
+
171
+
## Contribute
172
+
1. You can add your theme (see [ColorTheme](https://github.com/Softwee/codeview-android/blob/master/codeview/src/main/java/io/github/kbiakov/codeview/highlight/CodeHighlighter.kt) class). Try to add some classic color themes or create your own if it looks cool. You can find many of them in different open-source text editors.<br>
173
+
2. If you are strong in a regex add missed language as shown [here](https://github.com/Softwee/codeview-android/blob/master/codeview/src/main/java/io/github/kbiakov/codeview/highlight/prettify/lang/LangScala.java). You can find existing regex for some language in different sources of js-libraries, etc, which plays the same role.<br>
174
+
3. Various adapters also welcome, customization is unlimited.
0 commit comments