Update readme
This commit is contained in:
49
README.md
49
README.md
@@ -8,19 +8,42 @@ Library that provides manga sources.
|
||||
|
||||
1. Add it in your root build.gradle at the end of repositories:
|
||||
|
||||
```groovy
|
||||
allprojects {
|
||||
repositories {
|
||||
...
|
||||
maven { url 'https://jitpack.io' }
|
||||
```groovy
|
||||
allprojects {
|
||||
repositories {
|
||||
...
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
2. Add the dependency
|
||||
2. Add the dependency
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
implementation 'com.github.nv95:kotatsu-parsers:master-SNAPSHOT'
|
||||
}
|
||||
```
|
||||
For Java/Kotlin project:
|
||||
```groovy
|
||||
dependencies {
|
||||
implementation("com.github.nv95:kotatsu-parsers:$parsers_version")
|
||||
}
|
||||
```
|
||||
|
||||
For Android project:
|
||||
```groovy
|
||||
dependencies {
|
||||
implementation("com.github.nv95:kotatsu-parsers:$parsers_version") {
|
||||
exclude group: 'org.json', module: 'json'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
See for versions at [JitPack](https://jitpack.io/#nv95/kotatsu-parsers)
|
||||
|
||||
3. Usage in code
|
||||
|
||||
```kotlin
|
||||
val parser = MangaSource.MANGADEX.newParser(mangaLoaderContext)
|
||||
```
|
||||
|
||||
`mangaLoaderContext` is an implementation of the `MangaLoaderContext` class.
|
||||
See [Android](https://github.com/nv95/Kotatsu/blob/devel/app/src/main/java/org/koitharu/kotatsu/core/parser/MangaLoaderContextImpl.kt) and [Non-Android](https://github.com/nv95/kotatsu-dl/blob/master/src/main/kotlin/org/koitharu/kotatsu_dl/env/MangaLoaderContextImpl.kt) implementation examples.
|
||||
|
||||
Note that the `MangaSource.LOCAL` and `MangaSource.DUMMY` parsers cannot be instantiated.
|
||||
@@ -45,6 +45,7 @@ abstract class MangaParser @InternalParsersApi constructor(val source: MangaSour
|
||||
* @param tags genres for filtering, values from [getTags] and [Manga.tags]. May be null or empty
|
||||
* @param sortOrder one of [sortOrders] or null for default value
|
||||
*/
|
||||
@JvmSynthetic
|
||||
@InternalParsersApi
|
||||
abstract suspend fun getList(
|
||||
offset: Int,
|
||||
@@ -156,8 +157,7 @@ abstract class MangaParser @InternalParsersApi constructor(val source: MangaSour
|
||||
}
|
||||
|
||||
@InternalParsersApi
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
protected inline fun parseFailed(message: String? = null): Nothing {
|
||||
protected fun parseFailed(message: String? = null): Nothing {
|
||||
throw ParseException(message, null)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user