Skip to content

Instantly share code, notes, and snippets.

@jmnarloch
Created July 17, 2015 21:51
Show Gist options
  • Save jmnarloch/f83b9a614c571c501c68 to your computer and use it in GitHub Desktop.
Save jmnarloch/f83b9a614c571c501c68 to your computer and use it in GitHub Desktop.
Guardfile
require 'asciidoctor'
require 'erb'
options = {:to_dir => 'docs/dist/', :safe => 'safe', :mkdirs => true}
guard 'shell', :all_on_start => true do
watch(/^docs\/src\/main\/adoc\/.*\.adoc$/) {|m|
Asciidoctor.render_file(m[0], options)
}
end
@jmnarloch
Copy link
Author

Embedded images

require 'asciidoctor'
require 'erb'

options = {:to_dir => 'docs/dist/', :safe => 'safe', :mkdirs => true, :attributes => %w(imagesdir=../images data-uri)}

guard 'shell', :all_on_start => true do
  watch(/^docs\/src\/main\/adoc\/.*\.adoc$/) {|m|
    Asciidoctor.render_file(m[0], options)
  }
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment