Skip to content

Instantly share code, notes, and snippets.

@b-turchyn

b-turchyn/Gemfile

Created Apr 30, 2019
Embed
What would you like to do?
Serve and automatically compile Sphinx documentation

Usage

  1. Create Gemfile and Guardfile in main directory
  2. Run bundle to install guard components
  3. Run guard to handle builds and server
source 'https://rubygems.org'
gem 'guard'
gem 'guard-shell'
gem 'guard-process'
# Compile changes; swap .md out for .rst if not running Markdown
guard :shell do
ignore /_build/
watch(/(.*).md/) {|m| `make html` }
end
# Serve the build directory using WEBrick
guard 'process', :name => 'server', :command => 'ruby -run -ehttpd _build/html/ -p8000', :stop_signal => "KILL" do
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment