@@ -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.
4950func (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 (?).
7375func (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.
144147func (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.
148153func (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.
152158func (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