Created
May 17, 2011 01:39
-
-
Save bmarini/975725 to your computer and use it in GitHub Desktop.
Ronn manual for your gh-pages branch (taken from ddollar/foreman)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc 'Build the manual' | |
task :man do | |
require 'forker/version' | |
ENV['RONN_MANUAL'] = "Forker Manual" | |
ENV['RONN_ORGANIZATION'] = "Forker #{Forker::VERSION}" | |
sh "ronn -w -s toc -r5 --markdown man/*.ronn" | |
end | |
desc "Commit the manual to git" | |
task "man:commit" => :man do | |
sh "git add README.md" | |
sh "git commit -m 'update readme' || echo 'nothing to commit'" | |
end | |
desc "Generate the Github docs" | |
task :pages => "man:commit" do | |
sh %{ | |
cp man/forker.7.html /tmp/forker.7.html | |
git checkout gh-pages | |
rm ./index.html | |
cp /tmp/forker.7.html ./index.html | |
git add -u index.html | |
git commit -m "saving man page to github docs" | |
git push origin -f gh-pages | |
git checkout master | |
} | |
end | |
# One time task to create gh-pages branch | |
task :gh_pages do | |
sh %{ | |
git symbolic-ref HEAD refs/heads/gh-pages | |
rm .git/index | |
git clean -fdx | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment