AscidActor渲染_文件缺少CSS

AscidActor渲染_文件缺少CSS,css,ruby,ruby-2.0,asciidoctor,Css,Ruby,Ruby 2.0,Asciidoctor,从CLI运行AscidActor可创建带有嵌入式样式表的HTML文档: $ asciidoctor mysample.adoc .... <title>My First Experience with the Dangers of Documentation</title> <style> /* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */ article,

从CLI运行AscidActor可创建带有嵌入式样式表的HTML文档:

$ asciidoctor mysample.adoc

....
<title>My First Experience with the Dangers of Documentation</title>
<style>
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; }
...
$ascidoctor mysample.adoc
....
我对文档危险的第一次体验
/*AscidActor默认样式表| MIT许可证|http://asciidoctor.org */
文章,旁白,细节,图表,页脚,页眉,hgroup,main,nav,section,摘要{显示:block;}
...
但是,在Ruby文件中运行AscidActor不会:

r.rb:

#!/usr/bin/env ruby

require 'asciidoctor'
Asciidoctor.render_file('mysample.adoc', :in_place => true)

$ ./r.rb

...
<title>My First Experience with the Dangers of Documentation</title>
<link rel="stylesheet" href="./asciidoctor.css">
...
r.rb:
#!/usr/bin/env ruby
需要“AscidActor”
Asciidoctor.render_文件('mysample.adoc',:in_place=>true)
美元/卢比
...
我对文档危险的第一次体验
...
这并不意味着应该有任何区别。我错过了什么

详情:

  • AscidActor 0.1.4
  • ruby 2.0.0p247

要嵌入样式表,必须以“不安全”模式呈现文件:


从技术上讲,您只需要将安全模式设置为:server或:safe。只有:secure-safe模式(使用API时的默认模式)强制启用linkcss属性


我正在考虑在1.5.0中对此进行更改。我不认为在整个文档中添加样式是不安全的。此外,有很多方法可以覆盖此行为,因此不会丢失任何东西,但可用性肯定会得到提高。

要将其嵌入
guardfile
,我必须使用语法
Asciidoctor.render\u文件('mysample.adoc',{:in\u place=>true,:safe=>:safe})
require 'asciidoctor'
Asciidoctor.render_file('mysample.adoc', :in_place => true, :safe => 'unsafe')