pkgsite: golang.org/x/pkgsite/internal/testing/pagecheck Index | Files

package pagecheck

import "golang.org/x/pkgsite/internal/testing/pagecheck"

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

Package Files

pagecheck.go

func CanonicalURLPath Uses

func CanonicalURLPath(path string) htmlcheck.Checker

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

func DirectoryHeader Uses

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

DirectoryHeader checks a details page header for a directory.

func LicenseDetails Uses

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

LicenseDetails checks the details section of a license tab.

func ModuleHeader Uses

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

ModuleHeader checks a details page header for a module.

func OverviewDetails Uses

func OverviewDetails(ov *Overview) htmlcheck.Checker

OverviewDetails checks the details section of an overview tab.

func PackageHeader Uses

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

PackageHeader checks a details page header for a package.

func SubdirectoriesDetails Uses

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 Uses

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 Uses

func UnitDoc() htmlcheck.Checker

UnitDoc checks the doc section of the main page.

func UnitHeader Uses

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

UnitHeader checks a main page header for a unit.

func UnitReadme Uses

func UnitReadme() htmlcheck.Checker

UnitReadme checks the readme section of the main page.

type Overview Uses

type Overview struct {
    ModuleLink     string // relative link to module page
    ModuleLinkText string
    RepoURL        string
    PackageURL     string
    ReadmeContent  string
    ReadmeSource   string
}

Overview describes the contents of the overview tab.

type Page Uses

type Page struct {
    ModulePath       string
    Suffix           string // package or directory path after module path; empty for a module
    Version          string
    FormattedVersion string
    Title            string
    LicenseType      string
    LicenseFilePath  string
    IsLatest         bool   // is this the latest version of this module?
    LatestLink       string // href of "Go to latest" link
    PackageURLFormat string // the relative package URL, with one %s for "@version"; also used for dirs
    ModuleURL        string // the relative module URL
}

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

Package pagecheck imports 5 packages (graph). Updated 2020-10-28. Refresh now. Tools for package owners.