docs

package
v0.0.0-...-3518944 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2017 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package docs implements a Gondola application for browsing package documentation.

This application requires a Go source code checkout to be present on the server as well as GOROOT and GOPATH properly configured. Additionaly, a working Go installation is required to automatically download and update packages.

To configure the packages to list in the index, use DocsApp.Groups.

This application can also automatically fetch and update the packages listed in the index. See StartUpdatingPackages and StopUpdatingPackages.

Index

Constants

View Source
const (
	ListHandlerName    = "docs-list"
	StdListHandlerName = "docs-std-list"
	PackageHandlerName = "docs-package"
	SourceHandlerName  = "docs-source"
)

Variables

View Source
var (
	PackageTemplateName  = "package.html"
	PackagesTemplateName = "packages.html"
	SourceTemplateName   = "source.html"
)

Functions

func ListHandler

func ListHandler(ctx *app.Context)

func PackageHandler

func PackageHandler(ctx *app.Context)

func SourceHandler

func SourceHandler(ctx *app.Context)

func StartUpdatingPackages

func StartUpdatingPackages(ctx *doc.Environment, interval time.Duration)

StartUpdatingPackages starts regularly updating the packages listed in Groups at the given interval. Note that for updating packages, the system should have installed the client for the SCM systems used by them (e.g. git, hg, etc...). A working Go installation on the host is also required, since go get will be used to download them.

func StdListHandler

func StdListHandler(ctx *app.Context)

func StopUpdatingPackages

func StopUpdatingPackages()

StopUpdatingPackages stops updating packages. Note that an in-flight update won't be stopped, but no more updates will be scheduled.

Types

type App

type App struct {
	reusableapp.App
}

func New

func New(opts Options) *App

func (*App) Environment

func (a *App) Environment() *doc.Environment

type Group

type Group struct {
	Title    string
	Packages []string
}

Group represents a group of packages to be displayed under the same title. Note that all subpackages of any included package will also be listed. Packages must be referred by their import path (e.g. example.com/pkg).

type Options

type Options struct {
	Groups []*Group
}

Directories

Path Synopsis
doc
printer
Package printer implements printing of AST nodes.
Package printer implements printing of AST nodes.

Jump to

Keyboard shortcuts

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