@cryptotaxi247 / kubo / commits / 8d57f5070

feat(tour) add file basics

keep things in one file for now

Brian Tiger Chow committed Nov 4, 2014 at 22:15 UTC 8d57f507090ca1f67e7482892e3e6d9be07916e7
4 files changed +70 -44
tour/all.go
+64 -17
@@ -1,10 +1,6 @@
1 package tour
2
3 -import (
4 - "sort"
5 -
6 - c "github.com/jbenet/go-ipfs/tour/content"
7 -)
3 +import "sort"
4
5 func init() {
6 for _, t := range allTopics {
@@ -17,16 +13,67 @@ func init() {
13
14 // Topics contains a mapping of Tour Topic ID to Topic
15 var allTopics = []Topic{
20 - Topic{
21 - ID: ID("0.0"),
22 - Content: c.IntroHelloMars,
23 - },
24 - Topic{
25 - ID: ID("0.1"),
26 - Content: c.IntroTour,
27 - },
28 - Topic{
29 - ID: ID("0.2"),
30 - Content: c.IntroAboutIpfs,
31 - },
16 + Topic{ID: ID("0.0"), Content: IntroHelloMars},
17 + Topic{ID: ID("0.1"), Content: IntroTour},
18 + Topic{ID: ID("0.2"), Content: IntroAboutIpfs},
19 +
20 + // File Basics
21 + Topic{ID: ID("X.0"), Content: FileBasicsFilesystem},
22 + Topic{ID: ID("X.1"), Content: FileBasicsGetting},
23 + Topic{ID: ID("X.2"), Content: FileBasicsAdding},
24 + Topic{ID: ID("X.3"), Content: FileBasicsDirectories},
25 + Topic{ID: ID("X.3"), Content: FileBasicsDirectories},
26 + Topic{ID: ID("X.4"), Content: FileBasicsMounting},
27 + Topic{ID: ID("X.2"), Content: FileBasicsAdding},
28 +}
29 +
30 +// Introduction
31 +
32 +var IntroHelloMars = Content{
33 + Title: "Hello Mars",
34 + Text: `
35 + check things work
36 + `,
37 +}
38 +var IntroTour = Content{
39 + Title: "Hello Mars",
40 + Text: `
41 + how this works
42 + `,
43 +}
44 +var IntroAboutIpfs = Content{
45 + Title: "About IPFS",
46 +}
47 +
48 +// File Basics
49 +
50 +var FileBasicsFilesystem = Content{
51 + Title: "Filesystem",
52 + Text: `
53 + `,
54 +}
55 +var FileBasicsGetting = Content{
56 + Title: "Getting Files",
57 + Text: `ipfs cat
58 + `,
59 +}
60 +var FileBasicsAdding = Content{
61 + Title: "Adding Files",
62 + Text: `ipfs add
63 + `,
64 +}
65 +var FileBasicsDirectories = Content{
66 + Title: "Directories",
67 + Text: `ipfs ls
68 + `,
69 +}
70 +var FileBasicsDistributed = Content{
71 + Title: "Distributed",
72 + Text: `ipfs cat from mars
73 + `,
74 +}
75 +var FileBasicsMounting = Content{
76 + Title: "Getting Files",
77 + Text: `ipfs mount (simple)
78 + `,
79 }
tour/content/content.go deleted
-6
@@ -1,6 +0,0 @@
1 -package content
2 -
3 -type Content struct {
4 - Title string
5 - Text string
6 -}
tour/content/introduction.go deleted
-19
@@ -1,19 +0,0 @@
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
+6 -2
@@ -4,7 +4,6 @@ import (
4 "strconv"
5 "strings"
6
7 - content "github.com/jbenet/go-ipfs/tour/content"
7 u "github.com/jbenet/go-ipfs/util"
8 )
9
@@ -28,7 +27,12 @@ func (a IDSlice) Less(i, j int) bool { return a[i].LessThan(a[j]) }
27 // Topic is a type of objects that structures a tour topic.
28 type Topic struct {
29 ID ID
31 - content.Content
30 + Content
31 +}
32 +
33 +type Content struct {
34 + Title string
35 + Text string
36 }
37
38 // Topics is a sorted list of topic IDs