diff --git a/tour/all.go b/tour/all.go index 65ea92cbb6eb0456ba37ac7742d08cdd4b64d596..2deb9d645647c559be55cebc7b2d52c2cc53b4eb 100644 --- a/tour/all.go +++ b/tour/all.go @@ -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)) - } -} diff --git a/tour/chapter.go b/tour/chapter.go new file mode 100644 index 0000000000000000000000000000000000000000..6e28ec04076cda8c061d2efff5c07ddc07250203 --- /dev/null +++ b/tour/chapter.go @@ -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)) + } +}