feat(tour) initial content
@jbenet please review If this is a desirable format, I will put in the rest so we can start to make incrementatl progress on the actual copy. Separated content from topic so Ids can be seen and modified without excessive scrolling. Hopefully will make it easy to re-order content.
Brian Tiger Chow committed
Nov 4, 2014 at 21:53 UTC
8f6d6653ba5e612d3647a47fc19fdd728464b498
3 files changed
+35
-10
tour/all.go
+13
-7
@@ -1,6 +1,10 @@
1
package tour
2
3
-import "sort"
3
+import (
4
+ "sort"
5
+
6
+ c "github.com/jbenet/go-ipfs/tour/content"
7
+)
8
9
func init() {
10
for _, t := range allTopics {
@@ -14,13 +18,15 @@ func init() {
18
// Topics contains a mapping of Tour Topic ID to Topic
19
var allTopics = []Topic{
20
Topic{
17
- ID: ID("0"),
18
- Title: "Hello Mars",
19
- Text: "Hello Mars",
21
+ ID: ID("0.0"),
22
+ Content: c.IntroHelloMars,
23
+ },
24
+ Topic{
25
+ ID: ID("0.1"),
26
+ Content: c.IntroTour,
27
},
28
Topic{
22
- ID: ID("0.1"),
23
- Title: "Hello Mars 2",
24
- Text: "Hello Mars 2",
29
+ ID: ID("0.2"),
30
+ Content: c.IntroAboutIpfs,
31
},
32
}
tour/content/introduction.go
new
+19
@@ -0,0 +1,19 @@
1
+package content
2
+
3
+var IntroHelloMars = Content{
4
+ Title: "Hello Mars",
5
+ Text: `
6
+ check things work
7
+ `,
8
+}
9
+
10
+var IntroTour = Content{
11
+ Title: "Hello Mars",
12
+ Text: `
13
+ how this works
14
+ `,
15
+}
16
+
17
+var IntroAboutIpfs = Content{
18
+ Title: "About IPFS",
19
+}
tour/tour.go
+3
-3
@@ -4,6 +4,7 @@ import (
4
"strconv"
5
"strings"
6
7
+ content "github.com/jbenet/go-ipfs/tour/content"
8
u "github.com/jbenet/go-ipfs/util"
9
)
10
@@ -26,9 +27,8 @@ func (a IDSlice) Less(i, j int) bool { return a[i].LessThan(a[j]) }
27
28
// Topic is a type of objects that structures a tour topic.
29
type Topic struct {
29
- ID ID
30
- Title string
31
- Text string
30
+ ID ID
31
+ content.Content
32
}
33
34
// Topics is a sorted list of topic IDs