// Fake relative package path for built-ins. Documentation for all globals
// (not just exported ones) will be shown for packages in this directory.
-const builtinPkgPath = "builtin/"
+const builtinPkgPath = "builtin"
type PageInfoMode uint
return
}
- relpath := r.URL.Path[len(h.pattern):]
+ relpath := path.Clean(r.URL.Path[len(h.pattern):])
abspath := absolutePath(relpath, h.fsRoot)
mode := getPageInfoMode(r)
if relpath == builtinPkgPath {
title = "Package " + info.PDoc.PackageName
case info.PDoc.PackageName == fakePkgName:
// assume that the directory name is the command name
- _, pkgname := path.Split(path.Clean(relpath))
+ _, pkgname := path.Split(relpath)
title = "Command " + pkgname
default:
title = "Command " + info.PDoc.PackageName