Package claire (v1.1.5) [repository]

Index

Functions

func Generate(sourceDir, outputDir, repoURL, version, importPath string) error

Generate creates HTML documentation for all packages within a Go module.

Types

type FuncDoc

FuncDoc holds documentation for a single function or method.

type FuncDoc struct {
	Name      string
	Doc       string
	Signature template.HTML
}

type PackageDoc

PackageDoc holds all the documentation for a single package.

type PackageDoc struct {
	Name           string
	RepositoryURL  string
	Version        string
	ImportPath     string
	StyleSheetPath string
	Doc            string
	Functions      []FuncDoc
	Types          []TypeDoc
	Variables      []VarDoc
	Constants      []VarDoc
	SubPackages    []string
}

Functions

func Parse(dir string) (*PackageDoc, error)

Parse parses the Go package in the given directory and returns a PackageDoc. It does not populate metadata fields like RepositoryURL or Version.

Methods

func (p *PackageDoc) IsEmpty() bool

IsEmpty reports whether the package documentation is empty (has no content).

func (pkgDoc *PackageDoc) Render(outputPath string) error

Render generates the HTML documentation file using the embedded template.

type TypeDoc

TypeDoc holds documentation for a type definition and its methods.

type TypeDoc struct {
	Name       string
	Doc        string
	Definition template.HTML
	Functions  []FuncDoc // Constructors/factory functions associated with this type.
	Methods    []FuncDoc
}

type VarDoc

VarDoc holds documentation for a variable or constant declaration.

type VarDoc struct {
	Doc        string
	Definition template.HTML
}