Skip to content

Docs site: publish docs/ to GitHub Pages, one build per line, the stable line by default #417

Closed

Description

@CaffeinatedCoder

Problem

The consumer docs can only be read as Markdown on GitHub, and there are three problems with that:

  • Wrong line by default. GitHub shows main, which is the 11 preview line, while dotnet add package installs 10.x. Someone evaluating the library reads docs for a line they don't have.
  • Two audiences mixed. docs/ holds consumer guides (getting-started, why, ranges, value-sets, efcore, serialization, migration) next to contributor ones (architecture, testing, oracles, discard-triage), with no navigation that separates them.
  • No way in. There's no table of contents and no search across the guides, which run to about 6,000 lines.

A GitHub wiki is ruled out. It's a separate repository whose edits bypass PRs, so claims.json couldn't hold its sentences, and GitHub doesn't index the wikis of repositories with fewer than 500 stars.

Change

  • Build from docs/*.md as they are. A workflow publishes them to GitHub Pages without copying or transforming the source, so OracleCatalogueTests keeps holding the same text. Navigation comes from the site's config, not from splitting or merging pages. If a page has to change for the site, its claims follow in the same PR.
  • One build per supported line. release/10.x and main each publish their own docs. The stable line is the default URL, and 11.x is labelled preview until v11.0.0, when the default moves. Both are built by one workflow with main's config. A push to release/10.x publishes through workflow_run on the .NET workflow, so that branch needs no copy of site/ or the workflow, and nothing is cherry-picked.
  • Separate the audiences. Consumer guides form the main navigation; the contributor pages go under a "Contributing" section, or stay on GitHub only.
  • Repository links. The docs link to README.md, CHANGELOG.md, the package READMEs, CONTRIBUTING.md and contributor pages. Those files become pages, and whatever is left is rewritten to a GitHub URL on the build's branch, never by editing the sources.
  • README. Links to the site and stays the GitHub landing page.
  • Tool: DocFX (decided by the spike in the comments). It reads the API from the published assemblies, and the root README, the package READMEs, the changelog and the contributor docs become pages too, so the docs' relative links resolve without rewriting.

Done when

  • The site serves 10.x by default and 11.x under its own path, each rebuilt by CI on a push to its branch.
  • Every consumer page is reachable from the navigation, and no link is broken: a link check runs in the publish job.
  • CONTRIBUTING.md says how the docs are published, and the release steps cover moving the default at v11.0.0.

Activity

  1. added this to the 10.3.0 milestone on Oct 25, 2026
  2. CaffeinatedCoder commented on Oct 25, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Spike result: DocFX 2.81.0

    I ran it locally on main (c0c95ee) with the RC2 SDK, against the seven consumer guides and the four package assemblies.

    • It builds: 0 errors, 201 API pages, about 107 s. Tables, code blocks, the in-page outline and search all render. The API pages list extension methods on the type they extend (for example DateRange shows every RangeExtensions member), and no extension blocks exist in src/, so C# 14 isn't a concern.

    • Read the API from published DLLs, not from the csproj files. One dotnet publish of CodoMetis.ValueRanges.EFCore.PostgreSQL.NodaTime yields all four assemblies, their XML docs and their dependencies. Pointing DocFX at a plain bin folder can't resolve EF Core, Npgsql or NodaTime, and pointing it at a csproj makes DocFX load the preview SDK through MSBuild itself.

    • The config has to sit in the repo. DocFX rejects a content source outside its base directory unless the path is relative, so it goes in site/docfx.json with ../docs.

    • 18 broken-link warnings, all pointing outside the consumer set: ../README.md (7), architecture.md (4), ../CHANGELOG.md (2), the NodaTime package README (2), CONTRIBUTING.md and a skill file. All of them disappear if those files become site pages too, with no rewriting: the root README as the landing page, the package READMEs, the changelog, and the contributor docs under "Contributing". Anything left over is rewritten to a GitHub URL on the build's branch.

    • No tool has a version switcher worth adopting.

      • DocFX has none.
      • Material for MkDocs takes no new features since 9.7.0 and stops getting fixes on 2026-11-05.
      • Zensical's versioning is a temporary mike fork that isn't on PyPI.

      With two lines, subdirectories are enough: /10.x/ and /11.x/, a root page that redirects to /10.x/ until v11.0.0, and a link in the header to the other line.

    Decided

    • Generator: DocFX, pinned in .config/dotnet-tools.json.
    • Build: one workflow builds both refs, release/10.x with its own global.json (10.0.100) and main with RC2, each published and run through DocFX. It assembles /10.x/ and /11.x/ and deploys with actions/deploy-pages. It's triggered by a push to either branch (the workflow file exists on both) and checks out both refs, so every run produces the whole site.
    • Link check: the publish job runs DocFX with --warningsAsErrors.
    • Needed from the maintainer: set Settings → Pages → Source to "GitHub Actions". The workflow can't do that itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/releaseVersioning, changelogs, release wiringdocumentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions