Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tour) content #269

Merged
merged 15 commits into from
Nov 5, 2014
Prev Previous commit
Next Next commit
refactor(tour0 move chapter to it's own file
Brian Tiger Chow committed Nov 5, 2014
commit 2db25a6762a0411b827a023370e815da70af0ee4
19 changes: 1 addition & 18 deletions tour/all.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package tour

import (
"fmt"
"sort"
)
import "sort"

func init() {
for _, t := range allTopics {
@@ -93,17 +90,3 @@ var FileBasicsMounting = Content{
Text: `ipfs mount (simple)
`,
}

// Chapter is used to define a chapter once and derive IDs for any number of
// sections within.
//
// It's designed to make it easy to re-order chapters with minimal fuss.
//
// eg.
// Intro := Chapter(1)
// ID("1.1") == Intro(1)
func Chapter(number int) func(topic int) ID {
return func(topic int) ID {
return ID(fmt.Sprintf("%d.%d", number, topic))
}
}
14 changes: 14 additions & 0 deletions tour/chapter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import "fmt"

// sections within.
//
// It's designed to make it easy to re-order chapters with minimal fuss.
//
// eg.
// Intro := Chapter(1)
// ID("1.1") == Intro(1)
func Chapter(number int) func(topic int) ID {
return func(topic int) ID {
return ID(fmt.Sprintf("%d.%d", number, topic))
}
}