Skip to content

Latest commit

 

History

History
61 lines (49 loc) · 1.37 KB

File metadata and controls

61 lines (49 loc) · 1.37 KB

Adding a New Source

Quick Start

python scripts/add-source.py

Answer 4 questions:

  1. Source name (e.g., NovelFull)
  2. Website URL (e.g., https://novelfull.com)
  3. Language code (e.g., en)
  4. Is it a Madara site? (y/n)

What Gets Generated

Madara Sites (zero-code)

@MadaraSource(
    name = "MySite",
    baseUrl = "https://mysite.com",
    lang = "en",
    id = 12345L
)
object MySiteConfig

That's it! KSP generates everything else.

Regular Sites (with KSP annotations)

@Extension
@AutoSourceId(seed = "MySite")
@GenerateFilters(title = true, sort = true, sortOptions = ["Latest", "Popular"])
@GenerateCommands(detailFetch = true, chapterFetch = true, contentFetch = true)
abstract class MySite(deps: Dependencies) : SourceFactory(deps = deps) {
    // Just update the CSS selectors
}

Finding CSS Selectors

  1. Open the website in Chrome/Firefox
  2. Right-click any element → "Inspect"
  3. Find the class name or tag
  4. Test: document.querySelector(".your-selector")

Common Selectors

Element Try These
Novel card .novel-item, .book-item, .post
Title h1, .title, h3.name
Cover img, .cover img
Chapters .chapter-list li, ul.chapters a
Content .chapter-content p, .text p

Build & Test

./gradlew :sources:en:mysource:assembleDebug