Skip to content

Commit

Permalink
internal/doc: rename RenderParts to Render
Browse files Browse the repository at this point in the history
For golang/go#40850

Change-Id: I8cb2de424d8fc6b1ee4f48fa7ed68048340942e2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312329
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
  • Loading branch information
jba committed Apr 22, 2021
1 parent 754bc2c commit 762b7a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/frontend/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func renderDocParts(ctx context.Context, u *internal.Unit, docPkg *godoc.Package
} else if u.Path != u.ModulePath {
innerPath = u.Path[len(u.ModulePath)+1:]
}
return docPkg.RenderParts(ctx, innerPath, u.SourceInfo, modInfo, nameToVersion)
return docPkg.Render(ctx, innerPath, u.SourceInfo, modInfo, nameToVersion)
}

// sourceFiles returns the .go files for a package.
Expand Down
6 changes: 3 additions & 3 deletions internal/godoc/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ func sinceVersionFunc(modulePath string, nameToVersion map[string]string) func(n
}
}

// RenderParts renders the documentation for the package in parts.
// Render renders the documentation for the package.
// Rendering destroys p's AST; do not call any methods of p after it returns.
func (p *Package) RenderParts(ctx context.Context, innerPath string,
func (p *Package) Render(ctx context.Context, innerPath string,
sourceInfo *source.Info, modInfo *ModuleInfo, nameToVersion map[string]string) (_ *dochtml.Parts, err error) {
p.renderCalled = true

Expand Down Expand Up @@ -225,5 +225,5 @@ func RenderPartsFromUnit(ctx context.Context, u *internal.Unit) (_ *dochtml.Part
} else if u.Path != u.ModulePath {
innerPath = u.Path[len(u.ModulePath)+1:]
}
return docPkg.RenderParts(ctx, innerPath, u.SourceInfo, modInfo, nil)
return docPkg.Render(ctx, innerPath, u.SourceInfo, modInfo, nil)
}
2 changes: 1 addition & 1 deletion internal/godoc/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func TestRenderParts_SinceVersion(t *testing.T) {
// TF is a method.
"T.M": "v1.4.0",
}
parts, err := p.RenderParts(ctx, "p", si, mi, nameToVersion)
parts, err := p.Render(ctx, "p", si, mi, nameToVersion)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 762b7a6

Please sign in to comment.