Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kubo_final
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anastasiia Chirikova
kubo_final
Commits
2db25a67
Commit
2db25a67
authored
10 years ago
by
Brian Tiger Chow
Browse files
Options
Downloads
Patches
Plain Diff
refactor(tour0 move chapter to it's own file
parent
eba22da6
No related branches found
No related tags found
1 merge request
!1
New
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tour/all.go
+1
-18
1 addition, 18 deletions
tour/all.go
tour/chapter.go
+14
-0
14 additions, 0 deletions
tour/chapter.go
with
15 additions
and
18 deletions
tour/all.go
+
1
−
18
View file @
2db25a67
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
))
}
}
This diff is collapsed.
Click to expand it.
tour/chapter.go
0 → 100644
+
14
−
0
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.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment