Skip to content

Commit 6cf6611

Browse files
authored
Merge pull request #170 from strk/wiki-lint
Fix lint errors in models/wiki (just add methods docs)
2 parents 81f227e + 592a4ec commit 6cf6611

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

models/wiki.go

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func WikiPath(userName, repoName string) string {
4646
return filepath.Join(UserPath(userName), strings.ToLower(repoName)+".wiki.git")
4747
}
4848

49+
// WikiPath returns wiki data path for given repository.
4950
func (repo *Repository) WikiPath() string {
5051
return WikiPath(repo.MustOwner().Name, repo.Name)
5152
}
@@ -70,6 +71,7 @@ func (repo *Repository) InitWiki() error {
7071
return nil
7172
}
7273

74+
// LocalWikiPath returns the path to the local wiki repository (?).
7375
func (repo *Repository) LocalWikiPath() string {
7476
return path.Join(setting.AppDataPath, "tmp/local-wiki", com.ToStr(repo.ID))
7577
}
@@ -141,14 +143,18 @@ func (repo *Repository) updateWikiPage(doer *User, oldTitle, title, content, mes
141143
return nil
142144
}
143145

146+
// AddWikiPage adds a new wiki page with a given title.
144147
func (repo *Repository) AddWikiPage(doer *User, title, content, message string) error {
145148
return repo.updateWikiPage(doer, "", title, content, message, true)
146149
}
147150

151+
// EditWikiPage updates a wiki page identified by its title,
152+
// optionally also changing title.
148153
func (repo *Repository) EditWikiPage(doer *User, oldTitle, title, content, message string) error {
149154
return repo.updateWikiPage(doer, oldTitle, title, content, message, false)
150155
}
151156

157+
// DeleteWikiPage deletes a wiki page identified by its title.
152158
func (repo *Repository) DeleteWikiPage(doer *User, title string) (err error) {
153159
wikiWorkingPool.CheckIn(com.ToStr(repo.ID))
154160
defer wikiWorkingPool.CheckOut(com.ToStr(repo.ID))

0 commit comments

Comments
 (0)