Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ifyun/markdown-it-android
Android Markdown View
https://github.com/ifyun/markdown-it-android
android-library custom-view markdown markdown-viewer
Last synced: 27 days ago
JSON representation
Android Markdown View
- Host: GitHub
- URL: https://github.com/ifyun/markdown-it-android
- Owner: ifyun
- License: mit
- Created: 2021-03-19T07:30:31.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-28T09:52:17.000Z (over 3 years ago)
- Last Synced: 2023-08-28T02:06:33.106Z (over 1 year ago)
- Topics: android-library, custom-view, markdown, markdown-viewer
- Language: JavaScript
- Homepage:
- Size: 2.34 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-android
![License](https://img.shields.io/github/license/imcloudfloating/markdown-it-android)
![JitPack](https://jitpack.io/v/imcloudfloating/markdown-it-android.svg)Markdown View for Android, based on [markdown-it](https://github.com/markdown-it/markdown-it) and WebView.
## Preview
## Features
- Auto fit system theme
- Code Highlighting([highlight.js](https://github.com/highlightjs/highlight.js))
- HTML
- KaTeX([katex](https://github.com/KaTeX/KaTeX) and [markdown-it-katex](https://github.com/waylonflinn/markdown-it-katex))
- Container(info, success, warning, error)## Usage
### Setup
Add it in your root build.gradle at the end of repositories(for older gradle version):
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```Or add following to settings.gradle(for newer gradle version):
```groovy
dependencyResolutionManagement {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```Add the dependency:
```groovy
dependencies {
implementation 'com.github.imcloudfloating:markdown-it-android:1.0.4'
}
```### Use in project
**Required SDK Version >= 22**.
Data Binding:
```xml
```
No Data Binding:
```kotlin
val md = "# Hello, Markdown!"findViewById(R.id.markdown_view).markdownString = md
```> If the HTTP image link cannot be displayed, add `android:usesCleartextTraffic="true"` to `AndroidManifest.xml` of your project.
### Fields and methods
| Field/Method | Note |
| ------------------ | ------------------------------------------------------------ |
| `fitSystemTheme` | Default is `true`, auto fit system theme. |
| `darkTheme` | Use dark theme when `fitSystemTheme = false` |
| `markdownString` | The markdown content you want to show. |
| `urlClickListener` | Click listener for link. |