Documentation ¶
Overview ¶
Package utils implemented some useful functions.
Index ¶
- Variables
- func FilterDirName(name string) bool
- func FormatCode(w io.Writer, code *string, links []*Link)
- func GetProjectPath(importPath string) (projectPath string)
- func IsBrowseURL(s string) (importPath string, ok bool)
- func IsDocFile(n string) bool
- func IsGoRepoPath(importPath string) bool
- func IsGoSubrepoPath(importPath string) bool
- func IsValidRemotePath(importPath string) bool
- func LoadConfig(cfgPath string)
- func SaveConfig() error
- func SaveDocPage(docPath string, data []byte) int
- func SavePkgDoc(docPath string, readmes map[string][]byte)
- func TagSuffix(prefix, t string) string
- type LangType
- type Link
Constants ¶
This section is empty.
Variables ¶
var ( DocsJsPath string HvJsPath string )
var Cfg *goconfig.ConfigFile
var LangTypes []*LangType // Languages are supported.
Functions ¶
func FilterDirName ¶
FilterDirName guess the file or directory is or contains Go source files.
func FormatCode ¶
FormatCode highlights keywords and adds HTML links to them.
func GetProjectPath ¶
GetProjectPath returns project path of import path.
func IsBrowseURL ¶
IsBrowserURL returns importPath and true if URL looks like a URL for a VCS source browser.
func IsGoRepoPath ¶
IsGoRepoPath returns true if package is from standard library.
func IsGoSubrepoPath ¶
IsGoSubrepoPath returns true if package is from sub-repos.
func IsValidRemotePath ¶
IsValidRemotePath returns true if importPath is structurally valid for "go get".
func SaveDocPage ¶
SaveDocPage saves doc. content to JS file(s), it returns max index of JS file(s); it returns -1 when error occurs.
func SavePkgDoc ¶
SavePkgDoc saves readered readme.md file data.