internal/fetch/dochtml: render shortened func signatures in side nav

This change introduces a new method on Renderer, ShortSynopsis. It
is meant to be used in templates when rendering methods and functions
within the side navigation UI component.

Due to the limited horizontal space available, it omits the “func”
keyword, type information, and return values.

An example of functions and methods from the time package rendered
using this new method is below.

Functions
    After(d)
    Sleep(d)
    Tick(d)
Types
    type Duration
        ParseDuration(s)
        Since(t)
        Until(t)
        (d) Hours()
        (d) Microseconds()
        (d) Milliseconds()
        (d) Minutes()
        (d) Nanoseconds()
        (d) Round(m)
        (d) Seconds()
        (d) String()
        (d) Truncate(m)
    type Location
        FixedZone(name, offset)
        LoadLocation(name)
        LoadLocationFromTZData(name, data)
        (l) String()
    type Month
        (m) String()
    type ParseError
        (e) Error()

Updates b/148095016

Change-Id: I663eaafdc0baa3619e449ccd0d8ee8d601974392
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/763562
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
7 files changed
tree: 1ba5d887e7a703c7df6b3ae79db1d95f14d61aa7
  1. cmd/
  2. content/
  3. devtools/
  4. doc/
  5. internal/
  6. migrations/
  7. third_party/
  8. .gitignore
  9. .prettierignore
  10. .prettierrc.yaml
  11. all.bash
  12. cloudbuild.yaml
  13. CONTRIBUTING.md
  14. go.mod
  15. go.sum
  16. LICENSE
  17. PATENTS
  18. README.md
README.md

Pkg.go.dev

Pkg.go.dev is a website for discovering and evaluting Go packages and modules.

Roadmap

Pkg.go.dev launched in November 2019, and is currently under active development by the Go team.

Our current goal is to work on addressing the UX feedback we have received. You can expect pkg.go.dev to be slated for some design changes coming soon. We plan to share these designs for feedback with everyone once they are ready.

Longer term, we are working towards redirecting godoc.org traffic to pkg.go.dev. We want to ensure that we address users' needs in the process. Read more about our next steps for pkg.go.dev. Issues related to redirecting godoc.org traffic are being tracked in Go issue #39144. We plan to address these issues before redirecting traffic from godoc.org to pkg.go.dev.

We encourage everyone to begin using pkg.go.dev today for all of their needs and file feedback! You can redirect all of your requests from godoc.org to pkg.go.dev, by clicking Always use pkg.go.dev at the top of any page on godoc.org.

If you are having issues with pkg.go.dev, please first check the known issues before following the troubleshooting guide. If that does not give you the information you need, reach out to us.

Issues

You can chat with us on the #tools slack channel on the Gophers slack.

If you think you have an issue that needs fixing, or a feature suggestion, then please make sure you follow the steps to file an issue with the right information to allow us to address it.

Contributing

We would love your help!

Our canonical Git repository is located cat go.googlesource.com/discovery. There is a mirror of the repository at github.com/golang/discovery.

To contribute, please read our contributing guide.

License

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.