Update readme

pull/21/head
Koitharu 4 years ago
parent a353c99dd5
commit 42124fd3fc
No known key found for this signature in database
GPG Key ID: 8E861F8CE6E7CE27

@ -19,8 +19,31 @@ allprojects {
2. Add the dependency 2. Add the dependency
For Java/Kotlin project:
```groovy ```groovy
dependencies { dependencies {
implementation 'com.github.nv95:kotatsu-parsers:master-SNAPSHOT' 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 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 * @param sortOrder one of [sortOrders] or null for default value
*/ */
@JvmSynthetic
@InternalParsersApi @InternalParsersApi
abstract suspend fun getList( abstract suspend fun getList(
offset: Int, offset: Int,
@ -156,8 +157,7 @@ abstract class MangaParser @InternalParsersApi constructor(val source: MangaSour
} }
@InternalParsersApi @InternalParsersApi
@Suppress("NOTHING_TO_INLINE") protected fun parseFailed(message: String? = null): Nothing {
protected inline fun parseFailed(message: String? = null): Nothing {
throw ParseException(message, null) throw ParseException(message, null)
} }
} }
Loading…
Cancel
Save