Are documenting internal packages necessary? #7
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: tslocum/godoc-static#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the 'Some Major Bugs' issue I reported that packages containing either '\\', 'internal' or 'testdata' could savely be avoided as it's done in godoc. Now, I see document files for internal packages still being generated but not being listed in the index. I'm curious whether documenting internal packages could be avoided. It would be quite desirable as it saves about 40MB on 100MB go standard library documentation. I checked the links extensively and couldn't find any links that point to the internal packages. In exremely rare cases there might be links that do.
I made a cheap change in 'main.go' at line 375
from
"""
filterPkgs := pkgs
for _, pkg := range pkgs {
subPkgs := strings.Split(pkg, "/")
for i := range subPkgs {
pkgs = append(pkgs, strings.Join(subPkgs[0:i+1], "/"))
}
}
pkgs = filterPkgsWithExcludes(uniqueStrings(pkgs))
"""
to
"""
for _, pkg := range pkgs {
subPkgs := strings.Split(pkg, "/")
for i := range subPkgs {
pkgs = append(pkgs, strings.Join(subPkgs[0:i+1], "/"))
}
}
pkgs = filterPkgsWithExcludes(uniqueStrings(pkgs))
filterPkgs := pkgs
"""
I basically changed the position of the 'filterPkgs' variable. This is obviously a hack which is good enough for me. I'm curious whether it could be done properly.
Thanks. I've added a flag in case anyone needs to preserve these packages.