x/pkgsite: add source code links for constants #40939
At the moment, if you want to know that the constant
This requires knowing what file the constant is defined in, and navigating to figure out where the code is. We should consider providing source code links for constants.
The text was updated successfully, but these errors were encountered:
Logic for rendering code snippets from the output of render_decl is moved to a helper template. The </br> tag is removed for the Constants and Variables sections: https://photos.app.goo.gl/FosXd66T3nfufaXf7 For golang/go#40939 For golang/go#42486 Change-Id: Icfe61be5f164e0be54e5357602477fc9ed24b05d Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277632 Reviewed-by: Jonathan Amsterdam <email@example.com> Trust: Julie Qiu <firstname.lastname@example.org>
The $out.decl <pre> tag is now generated in the declaration.tmpl, instead of as a string concatentation in formatDeclHTML. This will make it easier to style this element in a future CL. For golang/go#40939 For golang/go#42486 Change-Id: I2f5c0a339020deac002ed32a12ccf68f691cba8f Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/277633 Trust: Julie Qiu <email@example.com> Run-TryBot: Julie Qiu <firstname.lastname@example.org> TryBot-Result: kokoro <email@example.com> Reviewed-by: Jamal Carvalho <firstname.lastname@example.org>
The HTML for the source code link is added. The style is set to display:none, and will be styled in a future CL. There are no user facing changes in this CL. For golang/go#40939 For golang/go#42486 Change-Id: I01ba3ead6b2d0a9ea7dc1488d3b9f5eadb33d472 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278434 Reviewed-by: Jamal Carvalho <email@example.com> Trust: Julie Qiu <firstname.lastname@example.org>