sourceygodoc

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2026 License: AGPL-3.0 Imports: 0 Imported by: 0

README

sourcey-godoc

Native Go documentation generator for Sourcey.

sourcey-godoc reads a Go module with the Go toolchain (go list, go/parser, go/doc) and can either generate a standalone static docs site or emit Sourcey's portable sourcey-godoc JSON snapshot. Sourcey's main CLI uses the same generator internally for live-mode Go docs builds.

Install

go install github.com/sourcey/sourcey/go/sourcey-godoc/cmd/sourcey-godoc@latest

The same extractor is also available through the main Sourcey npm package:

npm install -g sourcey
sourcey godoc --module . --packages ./... --out godoc.json

Native binaries are published as GitHub release assets for go/sourcey-godoc/v* tags. Package-manager manifests such as Homebrew, Scoop, and WinGet consume those assets and their published checksums.

Usage

Generate a standalone static Go docs site:

sourcey-godoc generate --module . --packages ./... --out site

The generated directory contains HTML pages, sourcey-godoc.css, llms.txt, llms-full.txt, and sourcey-godoc.json.

Generate only the portable snapshot:

sourcey-godoc snapshot --module . --packages ./... --out godoc.json

Common options:

  • --packages ./internal/... selects package patterns passed to go list.
  • --exclude ./vendor/... removes import-path prefixes after expansion.
  • --include-tests=false skips examples from *_test.go.
  • --include-unexported includes unexported symbols.

The emitted JSON snapshot is intended for Sourcey's godoc snapshot mode:

export default {
  navigation: {
    tabs: [
      {
        tab: "Go API",
        godoc: {
          mode: "snapshot",
          snapshot: "./docs/godoc.json",
        },
      },
    ],
  },
};

Documentation

Overview

Package sourceygodoc documents the Sourcey Go documentation generator module.

The module's primary surface is the sourcey-godoc CLI:

go install github.com/sourcey/sourcey/go/sourcey-godoc/cmd/sourcey-godoc@latest

The CLI reads a Go module through the Go toolchain and generates a static Go documentation site or Sourcey's portable godoc snapshot format. Sourcey's TypeScript CLI embeds this same module for live-mode docs builds, so the standalone CLI and Sourcey runtime share one implementation.

Directories

Path Synopsis
cmd
sourcey-godoc command
Package main is Sourcey's native Go documentation introspector.
Package main is Sourcey's native Go documentation introspector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL