implement Wiki#write_page

This commit is contained in:
Tom Preston-Werner
2010-04-13 14:45:48 -04:00
parent bcd8a0d1a4
commit 9d743ba341
5 changed files with 74 additions and 11 deletions
+10 -8
View File
@@ -280,20 +280,22 @@ Get a specific version of a given static file:
gollum.file('asset.js', '5ec521178e0eec4dc39741a8978a2ba6616d0f0a')
Write a new version of a given canonical page file (the file will be created
if it does not already exist) and commit the change.
Write a new version of a page (the file will be created if it does not already
exist) and commit the change. The file will be written at the repo root.
gollum.write_page('page-name', 'My wiki page contents')
commit = { :message => 'commit message',
:name => 'Tom Preston-Werner',
:email => 'tom@github.com' }
gollum.write_page('Page Name', :markdown, 'Page contents', commit)
Write a new version of a given canonical page file and specify a commit
message:
Update an existing page (keeps the same name, format, and directory location).
gollum.write_page('page-name', 'My wiki page contents', 'commit message')
gollum.update_page(page, 'Page contents', commit)
To delete a page and commit the change:
gollum.delete_page('page-name')
gollum.delete_page('Page Name')
Once again, you can optionally specify a commit message:
gollum.delete_page('page-name', 'commit message')
gollum.delete_page('Page Name', 'commit message')