Commit 8f6d6653 authored by Brian Tiger Chow's avatar Brian Tiger Chow

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.
parent 5335417d
package tour package tour
import "sort" import (
"sort"
c "github.com/jbenet/go-ipfs/tour/content"
)
func init() { func init() {
for _, t := range allTopics { for _, t := range allTopics {
...@@ -14,13 +18,15 @@ func init() { ...@@ -14,13 +18,15 @@ func init() {
// Topics contains a mapping of Tour Topic ID to Topic // Topics contains a mapping of Tour Topic ID to Topic
var allTopics = []Topic{ var allTopics = []Topic{
Topic{ Topic{
ID: ID("0"), ID: ID("0.0"),
Title: "Hello Mars", Content: c.IntroHelloMars,
Text: "Hello Mars",
}, },
Topic{ Topic{
ID: ID("0.1"), ID: ID("0.1"),
Title: "Hello Mars 2", Content: c.IntroTour,
Text: "Hello Mars 2", },
Topic{
ID: ID("0.2"),
Content: c.IntroAboutIpfs,
}, },
} }
package content
var IntroHelloMars = Content{
Title: "Hello Mars",
Text: `
check things work
`,
}
var IntroTour = Content{
Title: "Hello Mars",
Text: `
how this works
`,
}
var IntroAboutIpfs = Content{
Title: "About IPFS",
}
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"strconv" "strconv"
"strings" "strings"
content "github.com/jbenet/go-ipfs/tour/content"
u "github.com/jbenet/go-ipfs/util" u "github.com/jbenet/go-ipfs/util"
) )
...@@ -27,8 +28,7 @@ func (a IDSlice) Less(i, j int) bool { return a[i].LessThan(a[j]) } ...@@ -27,8 +28,7 @@ func (a IDSlice) Less(i, j int) bool { return a[i].LessThan(a[j]) }
// Topic is a type of objects that structures a tour topic. // Topic is a type of objects that structures a tour topic.
type Topic struct { type Topic struct {
ID ID ID ID
Title string content.Content
Text string
} }
// Topics is a sorted list of topic IDs // Topics is a sorted list of topic IDs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment