-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: restructure module documentation #33637
Comments
@myitcv noticed that |
Is there any reason for this issue to go through the proposal process? It seems like something to be decided by the cmd/go maintainers. |
@ianlancetaylor, mostly I think we'd like feedback on where to put new documentation that isn't tied to the release cycle: in I think our preference would be a new repository, so that the main |
OK. The latter point is related to #29206. |
Removed Proposal label. We'll want to talk about modifying x/website and maybe creating a new repo (x/doc?) soon. Perhaps that doesn't need to go through the proposal committee though. |
Change https://golang.org/cl/197640 mentions this issue: |
Change https://golang.org/cl/197638 mentions this issue: |
…OOT/doc In the "/doc" directory, files are now served from the content/static/doc, then from GOROOT/doc (where GOROOT is either a zip file or the GOROOT directory). This allows documentation to be moved to golang.org outside of the normal Go release cycle. For example, this CL moves (but does not modify) doc/docs.html here. Documentation that is tied to the Go release cycle (for example, doc/spec.html) will not be moved. Updates golang/go#33637 Updates golang/go#29206 Change-Id: I5f1c577e0ffddc3418653bdd9b0cc36cf79e3fe1 Reviewed-on: https://go-review.googlesource.com/c/website/+/197638 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Updates golang/go#33637 Change-Id: I37c81d2358c9b2c7ae11939b3884acea2612ff7d Reviewed-on: https://go-review.googlesource.com/c/website/+/197640 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Change https://golang.org/cl/199058 mentions this issue: |
Change https://golang.org/cl/199057 mentions this issue: |
See deletion CL here: https://golang.org/cl/199057 Updates golang/go#33637 Updates golang/go#29206 Change-Id: I992a6f3222b6327927578111ad71bdf3653adf78 Reviewed-on: https://go-review.googlesource.com/c/website/+/199058 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This is being moved to x/website in https://golang.org/cl/199058. Updates #33637 Updates #29206 Change-Id: I5c58b784fcdd212d7a003cd0f4085059f33a47c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/199057 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Change https://golang.org/cl/199117 mentions this issue: |
This page has moved to x/website in https://golang.org/cl/197638. Updates #33637 Updates #29206 Change-Id: I4f5f7822a2bf540a3911470548d38ccc7a66b74c Reviewed-on: https://go-review.googlesource.com/c/go/+/199117 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Jean de Klerk <deklerk@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
For golang/go#33637 Change-Id: I60d0b0c2c83c35dbb9ebbc200b781b2196320f87 Reviewed-on: https://go-review.googlesource.com/c/website/+/238277 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For golang/go#33637 Change-Id: I6b46d319e8f5dcf42db66c54d08ba7136375b43a Reviewed-on: https://go-review.googlesource.com/c/website/+/234489 Reviewed-by: Michael Matloob <matloob@golang.org>
For golang/go#33637 Change-Id: I5afa5373c00e0b0252ade069e84c67478379896f Reviewed-on: https://go-review.googlesource.com/c/website/+/240686 Reviewed-by: Michael Matloob <matloob@golang.org>
For golang/go#33637 Change-Id: I22f556cd0e1dcd76682d3f79143f1f28558f8766 Reviewed-on: https://go-review.googlesource.com/c/website/+/240688 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
For golang/go#33637 Change-Id: I58300dfe59b5e4e3cb118fd07f5a00419acc07b8 Reviewed-on: https://go-review.googlesource.com/c/website/+/242318 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
For golang/go#33637 Change-Id: I839a4075df8494389a69416e49e0fdc0ac812818 Reviewed-on: https://go-review.googlesource.com/c/website/+/244417 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
Previously, we used a separate <a> tag before the header. Headers had temporary ids, and the table of contents linked to those. With this change, the header elements themselves will have ids. For golang/go#33637 Change-Id: Ia79048f0db7cc4e8eac3bb5641278acd354fca01 Reviewed-on: https://go-review.googlesource.com/c/website/+/244766 Reviewed-by: Michael Matloob <matloob@golang.org>
* Added Introduction. This should say generally what modules are. It should also say this is a reference document, and point to tutorials for folks looking for those. * Edited some text in introductory sessions. * Replaced emphasis on new terms with <dfn> tags. Dropped emphasis from terms that are being mentioned, not defined. * Added glossary term for "vendor directory". * Removed some TODOs that are no longer relevant. For golang/go#33637 Change-Id: Iae6dcd28b392a4cd94351bc645a059ead3a7dfa8 Reviewed-on: https://go-review.googlesource.com/c/website/+/247758 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
For golang/go#33637 Change-Id: I629768ab8d2708a0f8dad8fa09840b519a9624cd Reviewed-on: https://go-review.googlesource.com/c/website/+/247759 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
For golang/go#33637 Change-Id: Ie502018aa23324732942e8fd82b45006096c3e1c Reviewed-on: https://go-review.googlesource.com/c/website/+/247760 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Clarify error fallback behavior and explain the difference between comma and pipe separators. For golang/go#33637 Change-Id: I3a8cf82284ea7c8e7096b8d8595f7cc7a21d7dba Reviewed-on: https://go-review.googlesource.com/c/website/+/247761 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Previously, Privacy was intended to be a top-level section. Now, it's grouped under Private modules, since it provides different advice depending on how private modules are being retrieved. For golang/go#33637 Change-Id: I5c70f7b7a0b01b3d5e2719f30d8bc66ffb25c046 Reviewed-on: https://go-review.googlesource.com/c/website/+/247762 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Also moved some content out of the go.sum section into authentication. The go.sum section is mostly focused on the format of go.sum files themselves, rather than the general topic of authentication. For golang/go#33637 Change-Id: Ie427924078c3fb7e1201867b3ef2836578e3b877 Reviewed-on: https://go-review.googlesource.com/c/website/+/247763 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Our markdown renderer was cutting off everything after the dot, so "go.mod-files" was rendered as "go". For golang/go#33637 Fixes golang/go#41080 Change-Id: Iefded0f697c4c9c8833303e83de7317c3930091a Reviewed-on: https://go-review.googlesource.com/c/website/+/248617 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
It's a less formal synonym for "main module". "Current module" is more intuitive when running commands which have a clear working directory, but "main module" may be used in more general contexts. For golang/go#33637 Change-Id: Ic41583de8deb7ad2e852a55c854cfb0fc6b86483 Reviewed-on: https://go-review.googlesource.com/c/website/+/276352 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For golang/go#33637 Change-Id: I689ddec1dbfc2f4c4c0d5a6b4503f430d648f6e5 Reviewed-on: https://go-review.googlesource.com/c/website/+/276353 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For golang/go#33637 Fixes golang/go#41267 Change-Id: Ic7928c05ef200b574afc15acdbabdc6ab2d5e30d Reviewed-on: https://go-review.googlesource.com/c/website/+/276354 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For golang/go#33637 Change-Id: Idb7006881b75394f2ffbfb6861fc8e54f19888ed Reviewed-on: https://go-review.googlesource.com/c/website/+/284588 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For golang/go#33637 Change-Id: Ia11c79a3923a333fe0b20b0ea18dcc63b294c338 Reviewed-on: https://go-review.googlesource.com/c/website/+/284589 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For golang/go#33637 Change-Id: I7a50195148dbf28c0c8eb01f4cf93463fbb269e6 Reviewed-on: https://go-review.googlesource.com/c/website/+/284591 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For golang/go#33637 Change-Id: Iba37b9ea0024e5c07d14d57861b4705d29f59e44 Reviewed-on: https://go-review.googlesource.com/c/website/+/285432 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
At this point, we're planning to have a single version of this document that describes functionality in the highest supported version of Go and notes where that differs from lower versions. Changes after this point describe functionality new in Go 1.16. For golang/go#33637 Change-Id: I485287ad724deb367da07d149cc862b7aff74c30 Reviewed-on: https://go-review.googlesource.com/c/website/+/284812 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For golang/go#33637 For golang/go#40276 Change-Id: I25ef2024867194bd7dc2e70157fef9123498f49d Reviewed-on: https://go-review.googlesource.com/c/website/+/285452 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
For golang/go#33637 Change-Id: Ifd33478f89496a06a51c9f6b9662928093163698 Reviewed-on: https://go-review.googlesource.com/c/website/+/286952 Trust: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com>
I think this is now go.dev/ref/mod |
Summary
Go module documentation is spread out over several sources. The canonical source is
go help
, but it's difficult to read in a terminal, and the HTML equivalent (golang.org/cmd/go) is hard to discover and lacks structure and examples. Many developers seem to have difficulty finding solutions to common problems and discovering reference material.This issue proposes restructuring module documentation into three main areas.
go help modules
and other pages should be shortened, pointing to the specification where appropriate. The quick reference should be mirrored at golang.org/cmd/doc, and updates should be linked to the Go release cycle.Specification
A complete reference for everything related to modules should be added as one or more structured documents linked from golang.org/doc under the References section. This is analogous to the Language specification or The Go memory model.
The specification should be written as HTML documents within the main Go repository. Updates on the website will be tied to the Go release cycle. This is desirable since things like the go.mod format and the proxy protocol are tied to the current release. The latest version of the documentation will always be visible from tip.golang.org.
The specification should include the following sections. Note that this is simply a rough list of headings to establish scope, not an outline, which will come later.
go help modules
) - how to enable or disable module aware mode.go help modules
) - overview of using modules, with an example go.mod file and mention ofgo mod init
.go help modules
) - defining terminology.go help modules
) - definition and format.go help modules
) - list of @ suffixes accepted bygo get
,go mod download
, etc.go get
- more detailed description ofgo get
flags and use of module queries.go help get
will link here.go help modules
) - how modules are extracted from vcs repo. Currently a pointer to https://research.swtch.com/vgo-modulego help modules
) - description of how modules are downloaded and verified against go.sum.go help modules
) -go mod vendor
and-mod=vendor
. We will need to define vendoring without relying on prior knowledge orGOPATH
documentation.go help module-private
) - hosting and accessing private modules. Currently, this is just about configuring the go command to avoid leaking information about private modules to the proxy and sumdb. We should includeGOAUTH
(when implemented; see cmd/go: define HTTP authentication extension mechanism #26232) and other mechanisms (.netrc, git config) for connecting to and authenticating with private servers.go help go.mod
)go help goproxy
) - Should describe fallback behavior.Quick reference
A quick reference for the Go command should be preserved in
go help
and golang.org/cmd/go/, which is generated from the same text. The quick reference should briefly describe each command and each flag. Quick reference pages may link to sections in the specification or occasionally guide articles, but they should not link to the wiki or external sources that may change or disappear.As with the specification, updates to the quick reference on the website will be tied to the Go release cycle.
The following changes should be made to
go help
:go help build
) to make them easier to find quickly. Reference documentation should be linked for details.go help build
). Content is already concise.Guide articles
Guide articles should teach developers how to accomplish specific tasks. Each article should focus on a specific topic or small group of related topics. Articles may be more verbose than reference documentation and should include more realistic examples.
Unlike reference documentation, guide articles may be published outside of the Go release cycle. Unlike blog articles, guide articles should be updated after they are published to include new features and best practices. Blog articles may be converted to guide articles after they are published.
Guide articles should be linked from the Learning Go section of golang.org/doc. See the Hosting section below for possible hosting locations.
The following is a non-exhaustive list of articles to be written.
go mod init
and limitations. Considerations for v2+ modules. Compatibility with GOPATH (minimal module compatibility).go list [-m] [-json]
,go mod why [-m]
,go mod graph
.go help modules
. Explains how to accomplish common tasks withgo get
andgo mod tidy
in more detail than the above documents.-insecure
flag.Hosting
The golang.org website is served using
golang.org/x/website/cmd/golangorg
. Currently, this binary has some static content built into thecontent/static
package. This includes some HTML, JS, CSS, and templates. Most content is extracted from the Go repository itself. For example, golang.org/doc is doc/docs.html.The blog is served on a separate site, blog.golang.org using the binary
golang.org/x/blog
. Content is written in thecontent
directory ingolang.org/x/tools/present
format.At the moment, there is no place for non-blog content to be published outside the Go release cycle. We are considering a few locations:
doc/articles
directory of the main Go repository.x/website
would need to serve pages in this directory atmaster
instead of from the latest release.golang.org/x/website
itself. Currently, this repository has not content (just templates, CSS, and JS). This would reduce the need to serve pages from multiple versions of the Go repository, but we'd at least need to servedoc/docs.html
from tip in order to update links outside the release cycle.Whereever we end up hosting articles, authors should be able to write in Markdown or a similar convenient format, rather than raw HTML.
The text was updated successfully, but these errors were encountered: