docs(tour) comment Chapter func
Brian Tiger Chow committed
Nov 4, 2014 at 22:34 UTC
b353f75e219f3de1cef84f51f3896c0d56444fdd
1 file changed
+6
tour/all.go
+6
@@ -94,6 +94,12 @@ var FileBasicsMounting = Content{
94
`,
95
}
96
97
+// Chapter is used to define a chapter once and derive IDs for any number of
98
+// sections within.
99
+//
100
+// eg.
101
+// Intro := Chapter(1)
102
+// ID("1.1") == Intro(1)
103
func Chapter(number int) func(topic int) ID {
104
return func(topic int) ID {
105
return ID(fmt.Sprintf("%d.%d", number, topic))