pagecheck

package
v0.0.0-...-82c4442 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package pagecheck implements HTML checkers for discovery site pages. It uses the general-purpose checkers in internal/testing/htmlcheck to define site-specific checkers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalURLPath

func CanonicalURLPath(path string) htmlcheck.Checker

CanonicalURLPath checks the canonical url for the unit on the page.

func LicenseDetails

func LicenseDetails(ltype, bodySubstring, source string) htmlcheck.Checker

LicenseDetails checks the details section of a license tab.

func SubdirectoriesDetails

func SubdirectoriesDetails(firstHref, firstText string) htmlcheck.Checker

SubdirectoriesDetails checks the detail section of a subdirectories tab. If firstHref isn't empty, it and firstText should exactly match href and text of the first link in the Directories table.

func UnitDirectories

func UnitDirectories(firstHref, firstText string) htmlcheck.Checker

UnitDirectories checks the directories section of the main page. If firstHref isn't empty, it and firstText should exactly match href and text of the first link in the Directories table.

func UnitDoc

func UnitDoc() htmlcheck.Checker

UnitDoc checks the doc section of the main page.

func UnitHeader

func UnitHeader(p *Page, versionedURL bool, isPackage bool) htmlcheck.Checker

UnitHeader checks a main page header for a unit.

func UnitReadme

func UnitReadme() htmlcheck.Checker

UnitReadme checks the readme section of the main page.

Types

type Page

type Page struct {
	// ModulePath is the module path for the unit page.
	ModulePath string

	// Suffix is the unit path element after module path; empty for a module
	Suffix string

	// Version is the full version of the module, or the go tag if it is the
	// stdlib.
	Version string

	// FormattedVersion is the version of the module, or go tag if it is the
	// stdlib. The version string may be truncated if it is a pseudoversion.
	FormattedVersion string

	// Title is output of frontend.pageTitle.
	Title string

	// LicenseType is name of the license.
	LicenseType string

	// LicenseFilePath is the path of the license relative to the module directory.
	LicenseFilePath string

	// IsLatestMinor is the latest minor version of this module.
	IsLatestMinor bool

	// MissingInMinor says that the unit is missing in the latest minor version of this module.
	MissingInMinor bool

	// IsLatestMajor is the latest major version of this series.
	IsLatestMajor bool

	// LatestLink is the href of "Go to latest" link.
	LatestLink string

	// LatestMajorVersion is the suffix of the latest major version, empty if
	// v0 or v1.
	LatestMajorVersion string

	// LatestMajorVersionLink is the link to the latest major version of the
	// unit. If the unit does not exist at the latest major version, it is a
	// link to the latest major version of the module.
	LatestMajorVersionLink string

	// UnitURLFormat is the relative unit URL, with one %s for "@version".
	UnitURLFormat string

	// ModuleURL is the relative module URL.
	ModuleURL string

	// CommitTime is the output of frontend.absoluteTime for the commit time.
	CommitTime string
}

Page describes a discovery site web page for a package, module or directory.

Jump to

Keyboard shortcuts

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