@@ -46,6 +46,7 @@ func WikiPath(userName, repoName string) string {
46
46
return filepath .Join (UserPath (userName ), strings .ToLower (repoName )+ ".wiki.git" )
47
47
}
48
48
49
+ // WikiPath returns wiki data path for given repository.
49
50
func (repo * Repository ) WikiPath () string {
50
51
return WikiPath (repo .MustOwner ().Name , repo .Name )
51
52
}
@@ -70,6 +71,7 @@ func (repo *Repository) InitWiki() error {
70
71
return nil
71
72
}
72
73
74
+ // LocalWikiPath returns the path to the local wiki repository (?).
73
75
func (repo * Repository ) LocalWikiPath () string {
74
76
return path .Join (setting .AppDataPath , "tmp/local-wiki" , com .ToStr (repo .ID ))
75
77
}
@@ -141,14 +143,18 @@ func (repo *Repository) updateWikiPage(doer *User, oldTitle, title, content, mes
141
143
return nil
142
144
}
143
145
146
+ // AddWikiPage adds a new wiki page with a given title.
144
147
func (repo * Repository ) AddWikiPage (doer * User , title , content , message string ) error {
145
148
return repo .updateWikiPage (doer , "" , title , content , message , true )
146
149
}
147
150
151
+ // EditWikiPage updates a wiki page identified by its title,
152
+ // optionally also changing title.
148
153
func (repo * Repository ) EditWikiPage (doer * User , oldTitle , title , content , message string ) error {
149
154
return repo .updateWikiPage (doer , oldTitle , title , content , message , false )
150
155
}
151
156
157
+ // DeleteWikiPage deletes a wiki page identified by its title.
152
158
func (repo * Repository ) DeleteWikiPage (doer * User , title string ) (err error ) {
153
159
wikiWorkingPool .CheckIn (com .ToStr (repo .ID ))
154
160
defer wikiWorkingPool .CheckOut (com .ToStr (repo .ID ))
0 commit comments