cra*_*aig 3 css ruby ruby-2.0 asciidoctor
从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; }
...
Run Code Online (Sandbox Code Playgroud)
但是,在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">
...
Run Code Online (Sandbox Code Playgroud)
该文件并不表示应该有任何区别.我错过了什么?
细节:
要嵌入样式表,您必须以"不安全"模式呈现文件:
require 'asciidoctor'
Asciidoctor.render_file('mysample.adoc', :in_place => true, :safe => 'unsafe')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
485 次 |
| 最近记录: |