doc

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: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 SetEnvironment

func SetEnvironment(s kvs.Storage, env *Environment)

func TypeId

func TypeId(name string) string

func VarId

func VarId(name string) string

Types

type Environment

type Environment struct {
	kvs.KVS
	Context   build.Context
	Separator string
	// contains filtered or unexported fields
}

func GetEnvironment

func GetEnvironment(s kvs.Storage) *Environment

func NewEnvironment

func NewEnvironment(reverseDoc, reverseSource func(string) string) *Environment

func (Environment) Base

func (e Environment) Base(p string) string

func (Environment) Dir

func (e Environment) Dir(p string) string

func (Environment) FromSlash

func (e Environment) FromSlash(p string) string

func (Environment) ImportPackage

func (e Environment) ImportPackage(p string) (*Package, error)

func (Environment) ImportPackageOpts

func (e Environment) ImportPackageOpts(p string, opts *ImportOptions) (*Package, error)

func (Environment) ImportPackages

func (e Environment) ImportPackages(dir string) ([]*Package, error)

func (Environment) IsAbs

func (e Environment) IsAbs(p string) bool

func (Environment) IsDir

func (e Environment) IsDir(p string) bool

func (Environment) Join

func (e Environment) Join(elem ...string) string

func (Environment) OpenFile

func (e Environment) OpenFile(path string) (io.ReadCloser, error)

func (Environment) ReadDir

func (e Environment) 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