【问题标题】:Asciidoctor.renderFile with additional options带有附加选项的 Asciidoctor.renderFile
【发布时间】:2014-07-23 09:05:04
【问题描述】:

我正在使用带有 here 描述的保护文件的 asciidoc。

鉴于 asciidoctor 选项:asciidoctor -a icons -a iconsdir /foo -a copycss bar.adoc 我想将这些选项添加到保护文件中。但我不知道怎么做。

保护文件目前看起来像:

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

【问题讨论】:

    标签: ruby guard asciidoc asciidoctor


    【解决方案1】:

    属性只是选项,本质上你可以在你拥有的选项中添加一个 :attributes 键,然后创建另一个哈希:

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

    应该没问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-24
      相关资源
      最近更新 更多