Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
2db25a67
Commit
2db25a67
authored
10 years ago
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(tour0 move chapter to it's own file
parent
eba22da6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
18 deletions
+15
-18
tour/all.go
tour/all.go
+1
-18
tour/chapter.go
tour/chapter.go
+14
-0
No files found.
tour/all.go
View file @
2db25a67
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
))
}
}
This diff is collapsed.
Click to expand it.
tour/chapter.go
0 → 100644
View file @
2db25a67
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
))
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment