Commit 2db25a67 authored by Brian Tiger Chow's avatar Brian Tiger Chow

refactor(tour0 move chapter to it's own file

parent eba22da6
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))
}
}
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))
}
}
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