GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add a Go linter for the docs/ content contract by kyleconroy · Pull Request #4584 · sqlc-dev/sqlc

Conversation

@kyleconroy

@kyleconroy kyleconroy commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #4583: docs/ is now validated in CI using Go and only Go.

The linter

internal/docs parses every page with goldmark (pure Go, CommonMark + GFM — the same parser Hugo uses) and enforces the contract an external site consumer relies on:

  • every page parses as GFM and starts with exactly one level-1 heading (the page title)
  • relative links and images resolve to files inside docs/; anchor fragments (config.md#database) are checked against GitHub-style heading slugs, including duplicate-heading -1 suffixes
  • every page appears exactly once in toc.yaml (section or unlisted), and every toc.yaml entry names a real file
  • no raw HTML or JSX, except HTML comments (git-cliff emits one in the changelog)
  • no MyST/Sphinx leftovers: :::{note} paragraphs and ```{note} fences are rejected with a pointer to GitHub alert syntax

It runs as TestDocs under plain go test ./..., reporting violations as file:line: message. A second test, TestLintViolations, pins the linter's own behavior against a synthetic tree that breaks each rule once. These are unit tests rather than endtoend cases because the contract is a property of the documentation tree, not of anything the sqlc CLI does.

What the linter caught

Running it against the existing docs found 24 real issues, all fixed here:

  • 8 MyST admonitions still using :::{note} / ```{note} (overrides, ci-cd, push, named_parameters) — converted to > [!NOTE] / > [!TIP]
  • 9 links that only resolved under Sphinx: extensionless (../howto/named_parameters) and .html (../guides/plugins.html) targets — now point at the actual .md files
  • 6 anchors that don't match GitHub slugging: #sqlc-db-prepare → #sqlcdb-prepare (slashes are dropped), #rules-using-explain-output → #rules-using-explain--output, #the-go-type-map → #the-go_type-map, and two stale #with-other-tools fragments in the changelog now link to the page itself
  • 1 missing title: the embedding guide started with an #### heading instead of #

Dependencies

Adds github.com/yuin/goldmark (no transitive dependencies).

🤖 Generated with Claude Code

https://claude.ai/code/session_013XDcHxZk9UzfzMLayG66Zq


Generated by Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Add a Go linter for the docs/ content contract
fd1f673
internal/docs validates the documentation source tree with goldmark and
runs from go test, so doc-breaking changes fail CI without any JavaScript
toolchain. It enforces the contract the external site consumer relies on:
every page parses as GFM and starts with exactly one level-1 heading;
relative links and images resolve to files inside docs/, with anchor
fragments checked against GitHub-style heading slugs; every page appears
exactly once in toc.yaml and every toc.yaml entry names a real page; no
raw HTML other than comments; and no leftover MyST directives.

Fix everything the linter found in the existing docs: convert the eight
remaining MyST admonitions to GitHub alert syntax, add the missing
level-1 heading to the embedding guide, point extensionless and .html
links (which only resolved under Sphinx) at the actual .md files, and
correct anchors that did not match GitHub slugging (#sqlcdb-prepare,
#rules-using-explain--output, #the-go_type-map, and stale
#with-other-tools fragments in the changelog).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013XDcHxZk9UzfzMLayG66Zq
@kyleconroy
kyleconroy merged commit 7d33de9 into main Aug 26, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kyleconroy
kyleconroy deleted the claude/docs-website-alternatives-naaa6t branch August 26, 2026 20:41
@jotikrishna jotikrishna mentioned this pull request Oct 7, 2026
docs: explain how to use the batch object #4633
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kyleconroy @claude
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.