Skip to content
Snippets Groups Projects
Commit 2db25a67 authored by Brian Tiger Chow's avatar Brian Tiger Chow
Browse files

refactor(tour0 move chapter to it's own file

parent eba22da6
No related branches found
No related tags found
1 merge request!1New
package tour package tour
import ( import "sort"
"fmt"
"sort"
)
func init() { func init() {
for _, t := range allTopics { for _, t := range allTopics {
...@@ -93,17 +90,3 @@ var FileBasicsMounting = Content{ ...@@ -93,17 +90,3 @@ var FileBasicsMounting = Content{
Text: `ipfs mount (simple) 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))
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment