diff --git a/README.md b/README.md index 68d3f334..358b02ce 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![markwon](https://img.shields.io/maven-central/v/ru.noties/markwon.svg?label=markwon)](http://search.maven.org/#search|ga|1|g%3A%22ru.noties%22%20AND%20a%3A%22markwon%22) [![markwon-image-loader](https://img.shields.io/maven-central/v/ru.noties/markwon-image-loader.svg?label=markwon-image-loader)](http://search.maven.org/#search|ga|1|g%3A%22ru.noties%22%20AND%20a%3A%22markwon-image-loader%22) +[![markwon-syntax](https://img.shields.io/maven-central/v/ru.noties/markwon-syntax.svg?label=markwon-syntax)](http://search.maven.org/#search|ga|1|g%3A%22ru.noties%22%20AND%20a%3A%22markwon-syntax%22) [![markwon-view](https://img.shields.io/maven-central/v/ru.noties/markwon-view.svg?label=markwon-view)](http://search.maven.org/#search|ga|1|g%3A%22ru.noties%22%20AND%20a%3A%22markwon-view%22) **Markwon** is a library for Android that renders markdown as system-native Spannables. It gives ability to display markdown in all TextView widgets (**TextView**, **Button**, **Switch**, **CheckBox**, etc), **Notifications**, **Toasts**, etc. **No WebView is required**. Library provides reasonable defaults for display style of markdown but also gives all the means to tweak the appearance if desired. All markdown features are supported (including limited support for inlined HTML code, markdown tables and images). @@ -12,9 +13,10 @@ ## Installation ```groovy -compile 'ru.noties:markwon:1.0.6' -compile 'ru.noties:markwon-image-loader:1.0.6' // optional -compile 'ru.noties:markwon-view:1.0.6' // optional +implementation 'ru.noties:markwon:1.0.6' +implementation 'ru.noties:markwon-image-loader:1.0.6' // optional +implementation 'ru.noties:markwon-syntax:x.x.x' // optional +implementation 'ru.noties:markwon-view:1.0.6' // optional ``` ### Snapshot @@ -35,10 +37,10 @@ allprojects { and then in your module `build.gradle`: ```groovy -implementation 'ru.noties:markwon:1.0.6-SNAPSHOT' +implementation 'ru.noties:markwon:1.1.0-SNAPSHOT' ``` -Please note that `markwon-image-loader` and `markwon-view` are also present in `SNAPSHOT` repository and share the same version as main `markwon` artifact. +Please note that `markwon-image-loader`, `markwon-syntax` and `markwon-view` are also present in `SNAPSHOT` repository and share the same version as main `markwon` artifact. ## Supported markdown features: * Emphasis (`*`, `_`) @@ -141,6 +143,12 @@ you can use [Better-Link-Movement-Method][better-link-movement-method]. Please refer to [SpannableConfiguration] document for more info +## Syntax highlight + +Starting with version `1.1.0` there is an artifact (`markwon-syntax`) that allows you to have syntax highlight functionality. +It is based on [Prism4j](https://github.com/noties/Prism4j) project. It contains 2 builtin themes: +`Default` (light, `Prism4jThemeDefault`) and `Darkula` (dark, `Prism4jThemeDarkula`). + --- # Demo diff --git a/library-image-loader/build.gradle b/library-image-loader/build.gradle index e9e70392..38da8be2 100644 --- a/library-image-loader/build.gradle +++ b/library-image-loader/build.gradle @@ -25,6 +25,10 @@ dependencies { api OK_HTTP } +afterEvaluate { + generateReleaseBuildConfig.enabled = false +} + if (project.hasProperty('release')) { apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle' } \ No newline at end of file diff --git a/library-syntax/build.gradle b/library-syntax/build.gradle index ea8156d0..585ac7f3 100644 --- a/library-syntax/build.gradle +++ b/library-syntax/build.gradle @@ -22,3 +22,7 @@ dependencies { afterEvaluate { generateReleaseBuildConfig.enabled = false } + +if (project.hasProperty('release')) { + apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle' +} \ No newline at end of file diff --git a/library-syntax/gradle.properties b/library-syntax/gradle.properties new file mode 100644 index 00000000..ba94baa1 --- /dev/null +++ b/library-syntax/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME=Markwon +POM_ARTIFACT_ID=markwon-syntax +POM_PACKAGING=aar \ No newline at end of file diff --git a/library-view/build.gradle b/library-view/build.gradle index bc867655..f8545a37 100644 --- a/library-view/build.gradle +++ b/library-view/build.gradle @@ -18,6 +18,10 @@ dependencies { compileOnly SUPPORT_APP_COMPAT } +afterEvaluate { + generateReleaseBuildConfig.enabled = false +} + if (project.hasProperty('release')) { apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle' } diff --git a/library/build.gradle b/library/build.gradle index dc757dfe..d62fad6d 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -20,6 +20,10 @@ dependencies { api COMMON_MARK_TABLE } +afterEvaluate { + generateReleaseBuildConfig.enabled = false +} + if (project.hasProperty('release')) { apply from: 'https://raw.githubusercontent.com/noties/gradle-mvn-push/master/gradle-mvn-push-aar.gradle' }