从CLI运行AsciiDoctor将创建一个带有嵌入样式表的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; }
...
然而,在 Ruby 文件中运行 Asciidoctor 并不行:
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">
...
文档中没有说明应该有任何区别。我错过了什么吗?详细信息:
- Asciidoctor 0.1.4
- ruby 2.0.0p247
guardfile
中,我必须使用语法Asciidoctor.render_file('mysample.adoc', {:in_place => true, :safe => :unsafe})
。 - craig