aboutsummaryrefslogtreecommitdiff
path: root/internal/api/testdata
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2026-03-21 16:52:49 -0400
committerJonathan Amsterdam <jba@google.com>2026-03-27 11:54:39 -0700
commit0f438ccc7dbe2f891f5f97594f7b6510e490c742 (patch)
tree616118e6c6178e26d3268dab682c27e1fe773898 /internal/api/testdata
parentc59880de3cd54955ef11b4187daf7f930badb5e2 (diff)
downloadgo-x-pkgsite-0f438ccc7dbe2f891f5f97594f7b6510e490c742.tar.xz
internal/api: render markdown documentation
Change-Id: I8adf1e62d19cf592cc8204264d99953e12da5843 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/760260 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com>
Diffstat (limited to 'internal/api/testdata')
-rw-r--r--internal/api/testdata/markdown.golden105
-rw-r--r--internal/api/testdata/pkg.go6
-rw-r--r--internal/api/testdata/text.golden6
3 files changed, 117 insertions, 0 deletions
diff --git a/internal/api/testdata/markdown.golden b/internal/api/testdata/markdown.golden
new file mode 100644
index 00000000..205546d0
--- /dev/null
+++ b/internal/api/testdata/markdown.golden
@@ -0,0 +1,105 @@
+# package pkg
+
+Package pkg has every form of declaration.
+
+### Heading {#hdr-Heading}
+
+Search [Google](https://google.com) for details.
+
+### Links {#hdr-Links}
+
+ - pkgsite repo, [https://go.googlesource.com/pkgsite](https://go.googlesource.com/pkgsite)
+ - Play with Go, [https://play-with-go.dev](https://play-with-go.dev)
+
+## Constants
+
+```
+const (
+ X = 1
+ Y = 2
+)
+```
+Several constants.
+
+```
+const C = 1
+```
+C is a shorthand for 1.
+
+## Variables
+
+```
+var V = 2
+```
+V is a variable.
+
+## Functions
+
+```
+func Add(x int) int
+```
+Add adds 1 to x.
+
+```
+func F()
+```
+F is a function.
+
+## Types
+
+```
+type A int
+```
+
+```
+type B bool
+```
+
+```
+type I1 interface {
+ M1()
+}
+```
+I1 is an interface.
+
+```
+type I2 interface {
+ I1
+ M2()
+}
+```
+
+```
+type S1 struct {
+ F int // field
+}
+```
+S1 is a struct.
+
+```
+type S2 struct {
+ S1
+ G int
+}
+```
+S2 is another struct.
+
+```
+type T int
+```
+T is a type.
+
+```
+const CT T = 3
+```
+CT is a typed constant. They appear after their type.
+
+```
+func TF() T
+```
+TF is a constructor for T.
+
+```
+func (T) M()
+```
+M is a method of T. BUG(xxx): this verifies that notes are rendered.
diff --git a/internal/api/testdata/pkg.go b/internal/api/testdata/pkg.go
index b9650bb8..6d62abad 100644
--- a/internal/api/testdata/pkg.go
+++ b/internal/api/testdata/pkg.go
@@ -4,10 +4,16 @@
// Package pkg has every form of declaration.
//
+// # Heading
+//
+// Search [Google] for details.
+//
// # Links
//
// - pkgsite repo, https://go.googlesource.com/pkgsite
// - Play with Go, https://play-with-go.dev
+//
+// [Google]: https://google.com
package pkg
// C is a shorthand for 1.
diff --git a/internal/api/testdata/text.golden b/internal/api/testdata/text.golden
index 6497759c..75998ec5 100644
--- a/internal/api/testdata/text.golden
+++ b/internal/api/testdata/text.golden
@@ -2,11 +2,17 @@ package pkg
Package pkg has every form of declaration.
+# Heading
+
+Search Google for details.
+
# Links
- pkgsite repo, https://go.googlesource.com/pkgsite
- Play with Go, https://play-with-go.dev
+[Google]: https://google.com
+
CONSTANTS
const (