doc

package
v0.0.0-...-ba7cdbd Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2014 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultContext = Context{Context: build.Default, Separator: string(filepath.Separator)}
)

Functions

func ConstId

func ConstId(name string) string

func FormatComments

func FormatComments(text string) string

func FormatNode

func FormatNode(fset *token.FileSet, node interface{}) (string, error)

func FuncId

func FuncId(name string) string

func FuncReceiver

func FuncReceiver(fn *ast.FuncDecl) string

func MethodId

func MethodId(typ string, name string) string

func TypeId

func TypeId(name string) string

func VarId

func VarId(name string) string

Types

type Context

type Context struct {
	build.Context
	Separator         string
	App               *app.App
	SourceHandlerName string
	DocHandlerName    string
	// contains filtered or unexported fields
}

func (Context) Base

func (c Context) Base(p string) string

func (Context) Dir

func (c Context) Dir(p string) string

func (Context) FromSlash

func (c Context) FromSlash(p string) string

func (Context) ImportPackage

func (c Context) ImportPackage(p string) (*Package, error)

func (Context) ImportPackageOpts

func (c Context) ImportPackageOpts(p string, opts *ImportOptions) (*Package, error)

func (Context) ImportPackages

func (c Context) ImportPackages(dir string) ([]*Package, error)

func (Context) IsAbs

func (c Context) IsAbs(p string) bool

func (Context) IsDir

func (c Context) IsDir(p string) bool

func (Context) Join

func (c Context) Join(elem ...string) string

func (Context) OpenFile

func (c Context) OpenFile(path string) (io.ReadCloser, error)

func (Context) ReadDir

func (c Context) ReadDir(p string) ([]os.FileInfo, error)

type Example

type Example struct {
	// contains filtered or unexported fields
}

func (*Example) Doc

func (e *Example) Doc() string

func (*Example) EmptyOutput

func (e *Example) EmptyOutput() bool

func (*Example) HTML

func (e *Example) HTML() (template.HTML, error)

func (*Example) Id

func (e *Example) Id() string

func (*Example) Key

func (e *Example) Key() string

func (*Example) Name

func (e *Example) Name() string

func (*Example) Output

func (e *Example) Output() string

func (*Example) Title

func (e *Example) Title() string

type ImportOptions

type ImportOptions struct {
	Shallow bool
}

type Kind

type Kind int
const (
	Const Kind = iota + 1
	Var
	Func
	Type
	Method
	Field
	IMethod
	Pkg
)

func (Kind) DocScore

func (k Kind) DocScore() int

type Package

type Package struct {
	Packages []*Package
	// contains filtered or unexported fields
}

func (*Package) CommandName

func (p *Package) CommandName() string

func (*Package) Dir

func (p *Package) Dir() string

func (*Package) Doc

func (p *Package) Doc() *doc.Package

func (*Package) Examples

func (p *Package) Examples() []*Example

func (*Package) File

func (p *Package) File(name string) *ast.File

func (*Package) FileSet

func (p *Package) FileSet() *token.FileSet

func (*Package) Filenames

func (p *Package) Filenames() []string

func (*Package) FuncExamples

func (p *Package) FuncExamples(fn *doc.Func) []*Example
func (p *Package) FuncLink(fn *ast.FuncDecl) string

func (*Package) Funcs

func (p *Package) Funcs() []*doc.Func

func (*Package) GoFilenames

func (p *Package) GoFilenames() []string

func (*Package) HTML

func (p *Package) HTML(text string) template.HTML

func (*Package) HTMLDecl

func (p *Package) HTMLDecl(node interface{}) (template.HTML, error)

func (*Package) HTMLDoc

func (p *Package) HTMLDoc() template.HTML

func (*Package) HasDoc

func (p *Package) HasDoc() bool

func (*Package) ImportPath

func (p *Package) ImportPath() string

func (*Package) Imports

func (p *Package) Imports() []string

func (*Package) IsEmpty

func (p *Package) IsEmpty() bool

func (*Package) IsMain

func (p *Package) IsMain() bool

func (*Package) IsStd

func (p *Package) IsStd() bool

func (*Package) LineCount

func (p *Package) LineCount() (int, error)

func (*Package) LinkType

func (p *Package) LinkType(x string, sel string) string

func (*Package) Linkify

func (p *Package) Linkify(comment string, group *ast.CommentGroup) string

func (*Package) Name

func (p *Package) Name() string

func (*Package) NewAST

func (p *Package) NewAST() (*token.FileSet, *ast.Package, error)

func (*Package) NonStdImports

func (p *Package) NonStdImports() []string

func (*Package) ReverseFilename

func (p *Package) ReverseFilename(filename string) string

func (*Package) ReverseFilenameLine

func (p *Package) ReverseFilenameLine(filename string, line int) string

func (*Package) ReversePos

func (p *Package) ReversePos(n ast.Node) string

func (*Package) ReversePosition

func (p *Package) ReversePosition(pos token.Position) string

func (*Package) ScopedHTML

func (p *Package) ScopedHTML(text string, scope interface{}) template.HTML

func (*Package) Stats

func (p *Package) Stats() (*Stats, error)

func (*Package) Synopsis

func (p *Package) Synopsis() string

type Stats

type Stats struct {
	Documented int
	ToDocument int
	// Indicates if the package has documentation.
	HasDoc       bool
	Undocumented []*Undocumented
	// contains filtered or unexported fields
}

func NewStats

func NewStats(p *Package) (*Stats, error)

func (*Stats) DocPenalty

func (s *Stats) DocPenalty() int

func (*Stats) DocumentedIncrease

func (s *Stats) DocumentedIncrease(k Kind) float64

func (*Stats) DocumentedPercentage

func (s *Stats) DocumentedPercentage() float64

func (*Stats) NoDocPenalty

func (s *Stats) NoDocPenalty() int

func (*Stats) Package

func (s *Stats) Package() *Package

type Undocumented

type Undocumented struct {
	Kind Kind
	Name string
	Type string
	Node ast.Node
}

func (*Undocumented) Id

func (u *Undocumented) Id() string

func (*Undocumented) String

func (u *Undocumented) String() string

Directories

Path Synopsis
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