Skip to content

Add SmithyDocGenTypelevelSitePlugin for sbt-typelevel-site integration#41

Closed
kubukoz wants to merge 2 commits into
mainfrom
typelevel-site-integration
Closed

Add SmithyDocGenTypelevelSitePlugin for sbt-typelevel-site integration#41
kubukoz wants to merge 2 commits into
mainfrom
typelevel-site-integration

Conversation

@kubukoz

@kubukoz kubukoz commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

  • New sbtTypelevelSitePlugin module providing SmithyDocGenTypelevelSitePlugin, which mounts smithy-docgen output as a Laika sub-page (default /smithy/) in a sbt-typelevel-site project
  • New smithyDocGenSettings: SettingKey[ObjectNode] on SmithyDocGenPlugin, default-derived from service+format. Users override with := or ~=. Cache key is the serialized settings node
  • smithyDocGenOutputDirectory: SettingKey[File] exposed so plugins can reference the output as a setting (needed because Laika's laikaInputs is a SettingKey and can't .value a TaskKey)
  • Scripted test typelevel-site/sample-site covering the wiring with plain markdown (no Python required)

Notes

Still TODO before merge

  • CI: scripted-discover + scripted job for the new module (sbt 1.x only)
  • Dogfood: `docs/` sub-build that consumes our own plugins via `publishLocal`
  • CI: build docs on PRs; deploy after publish on main

Test plan

  • Existing `docgen/sample-docs` scripted test still passes after refactor
  • New `typelevel-site/sample-site` scripted test passes locally
  • Add scripted job to ci.yml (next commit)

🤖 Generated with Claude Code

Wires the smithy-docgen output into a Laika site as a sub-page (default
mount: /smithy/) so users with sbt-typelevel-site don't have to manage
the integration themselves.

Lives in a separate sbtTypelevelSitePlugin module so users not on
sbt-typelevel-site don't pick up the dependency. The module is sbt 1.x
only — sbt-typelevel-site doesn't yet support sbt 2 (tracked at
typelevel/sbt-typelevel#872).

Default format is plain Format.Markdown so users don't need a Python
toolchain. Format.SphinxMarkdown remains opt-in for cleaner rendering.

Replaces the SmithyDocGenPlugin's service+format-driven settings with a
single smithyDocGenSettings: SettingKey[ObjectNode], default-derived
from service+format. Users can override or transform with sbt's normal
:= and ~= operators. The cache key is the serialized settings node, so
service/format/extras collapse into a single hashable input.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Extracts the discover+run job-pair pattern (and the matrix-quoting
workaround for typelevel/sbt-typelevel#887) into
project/ScriptedMatrix.scala so adding a second scripted axis is
a single helper call rather than ~30 lines of duplicated YAML config.

Adds a scripted-site job pinned to Scala 2.12 (sbtTypelevelSitePlugin
is sbt 1.x only) that fans out over sbtTypelevelSitePlugin/src/sbt-test.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@kubukoz

kubukoz commented May 8, 2026

Copy link
Copy Markdown
Member Author

Scope reduced — opening a new PR with just the smithyDocGenSettings refactor and the ScriptedMatrix CI helper. The sbt-typelevel-site integration is being parked: rendering smithy-docgen markdown cleanly inside Laika hit too many edge cases (link rewriting under LinkValidation, anchor casing, smithy-docgen autoBuild bug, etc.) to be worth the complexity right now.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant