Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
Automatically set template_dirs for Reveal.js backend when running on…
Browse files Browse the repository at this point in the history
… Node.js
  • Loading branch information
ggrossetie committed Sep 25, 2016
1 parent ad24115 commit a97fb97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/asciidoctor/core_ext/factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def create backend, opts = {}
ManPageConverter.new backend, opts
end

if backend == 'revealjs' && (JAVASCRIPT_PLATFORM == 'node' || JAVASCRIPT_PLATFORM == 'node-electron')
if ::File.exist?(revealjs_templates_path = 'node_modules/asciidoctor-reveal.js/templates')
opts[:template_dirs] = revealjs_templates_path unless opts.key? :template_dirs
end
end

return base_converter unless opts.key? :template_dirs

unless defined? ::Asciidoctor::Converter::TemplateConverter
Expand Down

0 comments on commit a97fb97

Please sign in to comment.