0

I'm using asciidoc with a guard file descibed here.

Given the asciidoctor options: asciidoctor -a icons -a iconsdir /foo -a copycss bar.adoc I want to add those options to the guard file. But I don't know how.

The guard file currently looks like:

require 'asciidoctor'
require 'erb'

guard 'shell' do
  watch(/^ble\.adoc$/) {|m|
    Asciidoctor.render_file(m[0], :in_place => true, :backend => 'html5')
  }
end

guard 'livereload' do
  watch(%r{^.+\.(css|js|html)$})
end
matcauthon
  • 2,261
  • 1
  • 24
  • 41

1 Answers1

1

Attributes are just options, essentially you could add an :attributes key to the options you have there and make that another hash:

Asciidoctor.render_file(m[0], :in_place => true, :backend => 'html5', :attributes => { :icons => true, :copycss => true })

That should work just fine

LightGuard
  • 5,298
  • 19
  • 19