@cryptotaxi247 / kubo / commits / 2db25a676

refactor(tour0 move chapter to it's own file

Brian Tiger Chow committed Nov 4, 2014 at 22:36 UTC 2db25a6762a0411b827a023370e815da70af0ee4
2 files changed +15 -18
tour/all.go
+1 -18
@@ -1,9 +1,6 @@
1 package tour
2
3 -import (
4 - "fmt"
5 - "sort"
6 -)
3 +import "sort"
4
5 func init() {
6 for _, t := range allTopics {
@@ -93,17 +90,3 @@ var FileBasicsMounting = Content{
90 Text: `ipfs mount (simple)
91 `,
92 }
96 -
97 -// Chapter is used to define a chapter once and derive IDs for any number of
98 -// sections within.
99 -//
100 -// It's designed to make it easy to re-order chapters with minimal fuss.
101 -//
102 -// eg.
103 -// Intro := Chapter(1)
104 -// ID("1.1") == Intro(1)
105 -func Chapter(number int) func(topic int) ID {
106 - return func(topic int) ID {
107 - return ID(fmt.Sprintf("%d.%d", number, topic))
108 - }
109 -}
tour/chapter.go new
+14
@@ -0,0 +1,14 @@
1 +import "fmt"
2 +
3 +// sections within.
4 +//
5 +// It's designed to make it easy to re-order chapters with minimal fuss.
6 +//
7 +// eg.
8 +// Intro := Chapter(1)
9 +// ID("1.1") == Intro(1)
10 +func Chapter(number int) func(topic int) ID {
11 + return func(topic int) ID {
12 + return ID(fmt.Sprintf("%d.%d", number, topic))
13 + }
14 +}