Skip to content

Instantly share code, notes, and snippets.

@bmarini
Created May 17, 2011 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmarini/975725 to your computer and use it in GitHub Desktop.
Save bmarini/975725 to your computer and use it in GitHub Desktop.
Ronn manual for your gh-pages branch (taken from ddollar/foreman)
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