Skip to content

docs-site: rebuild the documentation with Astro and Starlight - #2485

Open
renaudmathieu wants to merge 5 commits into
InsertKoinIO:mainfrom
renaudmathieu:docs/astro-starlight
Open

renaudmathieu wants to merge 5 commits into
InsertKoinIO:mainfrom
renaudmathieu:docs/astro-starlight

Conversation

@renaudmathieu

@renaudmathieu renaudmathieu commented Nov 3, 2026 •

Copy link
Copy Markdown

Summary

Rebuilds the Koin documentation as an Astro and Starlight site in docs-site/, organized by platform (Kotlin, Android, Compose, Kotlin Multiplatform, Ktor), with code blocks that CI compiles and runs. The legacy docs/ folder is not touched, and the site is not deployed by this PR.

What changes

  • Site: 94 pages covering Get Started, Concepts, Platforms, Testing, Tooling, Migration, Reference and Support. Old URLs are kept through src/data/redirects.json.
  • Get Started: the path is now Quickstart, How Koin works, Install Koin, then Koin DSL or annotations? The Quickstart runs from an empty folder, then breaks on purpose to show the build error. What is DI moves to Concepts, and Why Koin moves to a new Evaluate Koin group with Koin vs Hilt.
  • Theme: the insert-koin.io brand (Raleway self-hosted, orange and dark palette, dark top bar and hero). In light mode, links stay brown because the brand orange fails contrast on white.
  • Tested snippets: blocks marked {/* check: scenario */} are extracted and built by JVM, Android (Robolectric), KMP and real multi-module harnesses. 138 of the 317 Kotlin blocks on platform pages are checked, starting with the riskiest pages. npm run coverage:snippets gives the count per page.
  • Compile safety is tested too: check:compile-failures breaks generated code in 11 cases, including the Quickstart, and requires the build to fail with KOIN-D001.
  • Style tabs: koin-style tabs only hold what differs between styles.
  • New checks in CI (.github/workflows/docs-site.yml): redirects, Koin symbols, page templates, style tabs, snippets and compile failures.

Changes outside docs-site/

  • AGENTS.md and projects/CLAUDE.md: the runTest rule for commonTest is reversed. On JS and Wasm, fun test() { runTest { } } discards the promise, so a failing test passes. The rule now asks for fun test() = runTest { }. Checked with Kotlin 2.3.20 and coroutines 1.10.2.
  • .github/workflows/docs-site.yml: new workflow.

Before switching over

  • legacy.insert-koin.io does not exist yet. Until it does, the 121 redirects for 4.1 and 4.0 and the "Older versions" links lead nowhere.
  • docs-site/REPORT.md and docs-site/audit/ are working documents: decide whether they stay. REPORT.md says which of its measurements predate the latest changes.

Known limits

  • The workflow has only run on this PR so far.
  • Nothing runs on a device or an iOS simulator. Swift is typechecked locally only, and is not in CI.
  • The Quickstart was replayed from code extracted from the built page, in an empty folder, with JDK 17 and the Gradle 9.8.2 wrapper. It prints the documented output and the documented error. An earlier draft also ran on Gradle 8.14.3. No platform tutorial was followed by hand from an empty project, and no real reader has timed the Quickstart.
  • UserActivity in How Koin works is compiled but never launched. The composable path runs.
  • The adoption figures on Why Koin are a snapshot from November 2, 2026, and were not measured again for this update.
  • A reader who switches from Annotations to Constructor keeps Annotations on two-tab groups until the page reloads, because Starlight syncs tabs by exact label.
  • compose/scopes says there is no annotation for the navigation scope. @Scope(NavBackStackEntry::class) may work, and this was not tested.
  • get-started/dsl-or-annotations assumes that a library built with the Compiler Plugin requires the plugin from its users. No page confirms this and the plugin source is not in this repository: to be confirmed by a maintainer.
  • Links to the old anchors of platforms/android/ no longer land on their section (content moved to startup-options).

For maintainers to review

  • The positioning of the Why Koin page, including the claim that Koin leads the public adoption signals for Kotlin Multiplatform.
  • The benchmark figures on Why Koin come from a 4.2.0-BETA1 run.
  • The plugin error prints required by: dsl:UserService, and the Quickstart shows that dsl: prefix as is.

Related

To raise separately: the multimodule-ktor sample calls an API deprecated at ERROR level, KoinNavigationScope leaks its scope and its KDoc says otherwise, KoinFragmentScope reads the Activity scope, and there is no public API to resolve a ViewModel from iOS.

Test plan

From docs-site/, with ANDROID_HOME set:

  • npm run build (94 pages, internal links valid)
  • npm run check:redirects, check:symbols, check:templates, check:tabs
  • npm run check:snippets, check:snippets:android, check:snippets:kmp, check:snippets:multimodule
  • npm run check:compile-failures (11 of 11)
  • The workflow passes in CI

Add a new site in docs-site/, organized by platform, with old URLs kept through
redirects. Marked code blocks are compiled and run by JVM, Android, KMP and
multi-module harnesses, and compile failures are checked for KOIN-D001.

Add the docs-site CI workflow, and reverse the runTest rule in AGENTS.md and
projects/CLAUDE.md: a block body discards the promise on JS and Wasm, so failing
tests pass.
Use the brand of the current site: self-hosted Raleway, #f8b133 and its
dark surfaces, a dark top bar and homepage hero in both themes, brand
primary buttons, a brand bar for the current page, and a single
0.4rem radius.

Links stay a darker shade in the light theme, because the brand orange
on white is only about 1.9:1.
Replace the Welcome page with a Quickstart that a reader can run from an
empty folder, then break on purpose to see the compile-time check.

- Rename the pages: How Koin works, Install Koin, Koin DSL or annotations?
- Move What is DI to Concepts and Why Koin out of Get Started, into a new
  Evaluate Koin sidebar group with Koin vs Hilt.
- Rewrite the pages on one example (UserRepository, UserService,
  UserApplication) and add snippet fixtures for every Kotlin block.
- Add the Quickstart to the compile-failure cases (11 cases).
- Update redirects, the decision map, diagrams and links across the site.

Correct claims found while validating the text:

- Constructor and Classic DSL need Kotlin 2.2 or later with Koin 4.2.
- Annotations without the plugin remain possible with the deprecated KSP
  processor.
- Applying the plugin to existing modules can report hidden problems.
- koin-core targets are now listed, as it has no androidNative or wasmWasi.
- "No reflection" now applies to the generated wiring only.
- artifacts.mdx now states the runtime Kotlin minimum, matching the FAQ.
- The glossary no longer limits class annotations to two special cases.
Reflect the open PR, the snippet and compile-failure checks, the Get Started restructure, the theme and the CI workflow. State which measurements predate these changes.
Test Examples failed to resolve binary-compatibility-validator 0.18.1 on 8525969. No content change.
@arnaudgiuliani
arnaudgiuliani self-requested a review November 5, 2026 15:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant