- Create
Gemfile
andGuardfile
in main directory - Run
bundle
to install guard components - Run
guard
to handle builds and server
Created
April 30, 2019 15:50
-
-
Save b-turchyn/5ebaf893464bfa6eb635b7ed2df991f4 to your computer and use it in GitHub Desktop.
Serve and automatically compile Sphinx documentation
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
source 'https://rubygems.org' | |
gem 'guard' | |
gem 'guard-shell' | |
gem 'guard-process' |
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
# 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