ruby - 使用 Rake 时使用 Reveal.js 作为 Asciidoctor 后端
问题描述
我想在Asciidoctor Reveal.js的帮助下创建一些幻灯片,并认为使用 Rake 构建我的幻灯片就足够了。但我要 s****d 将 Reveal.js 设置为 Asciidoctor 的后端。
require 'asciidoctor'
task default: %w[html5]
MASTER_FILENAME='slides.adoc'
OUTPUT_FILENAME='index.html'
task :html5 do
puts "Source is #{MASTER_FILENAME}"
begin
Asciidoctor.convert_file MASTER_FILENAME,
safe: :safe,
to_file: OUTPUT_FILENAME
backend: 'revealjs'
puts "\t#{OUTPUT_FILENAME} created"
rescue StandardError => e
puts "\t" + e.message
end
end
任何建议如何启用 Reveal.js 作为后端?
解决方案
Reveal.js 本身并不是 Asciidoctor 的后端。
asciidoctor-reveal.js
是一个转换器,它协调将 Asciidoctor 源文件转换为使用 Reveal.js 的 HTML。通过使用 asciidoctor.js,asciidoctor-reveal.js
可以在运行时注册为 asciidoctor.js 后端(它对基于 Ruby 的asciidoctor
命令行工具没有影响)。
您需要调整您的 rake 处理以遵循此处的说明:https ://asciidoctor.org/docs/asciidoctor-revealjs/#node-javascript-setup
推荐阅读
- ruby - Ruby 中的问号而不是非 ASCII 符号使用 Windows 终端
- sql - 使用 row_number 使用前一行值更新列值
- i3 - 是否可以在同一屏幕的顶部有一个 polybar(或任何其他 i3bar),而另一个在同一屏幕的底部?
- c# - 如何在界面之间进行转换?
- python - 具有 3 个变量的开关盒
- game-physics - Defold 物理,呆滞
- database - 具有自定义输出的条件聚合
- python - SQLAlchemy 中的 Backref 返回空列表
- ios - SwiftUI HStack 不会移到最顶端?
- vhdl - 尝试为 DE1SoC 合成 Verilog 代码时出错?