Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config plugins #196

Merged
merged 9 commits into from
Jul 28, 2018
15 changes: 15 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,21 @@ look at the
theme documentation] and use the `revealjs_customtheme` AsciiDoc attribute to
activate it.

=== Additional plugins

The plugins shipped with reveal.js are enabled per default.

To add additional plugins, download the and specify them in a comma separated list in a file that is accessible from your presentation.

If plugins needs additional configuration, add this in on other file.

To make asciidoctor-reveal aware of these plugins specify the following attributes:

----
:revealjs_plugins_add: myplugins/add.js
:revealjs_plugins_setup: myplugins/setup.js
----

== Minimum Requirements

* asciidoctor 1.5.6
Expand Down
11 changes: 8 additions & 3 deletions templates/document.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
link rel='stylesheet' href='#{revealjsdir}/css/theme/#{attr 'revealjs_theme', 'black'}.css' id='theme'
- if attr? :icons, 'font'
- if attr? 'iconfont-remote'
link rel='stylesheet' href=(attr 'iconfont-cdn', %(#{cdn_base}/font-awesome/4.3.0/css/font-awesome.min.css))
link rel='stylesheet' href=(attr 'iconfont-cdn', %(#{cdn_base}/font-awesome/4.5.0/css/font-awesome.min.css))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be done in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, there is even a newer font-awesome

- else
link rel='stylesheet' href=(normalize_web_path %(#{attr 'iconfont-name', 'font-awesome'}.css), (attr 'stylesdir', ''), false)
- if attr? :stem
Expand Down Expand Up @@ -198,8 +198,13 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
{ src: '#{revealjsdir}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
#{(attr? 'source-highlighter', 'highlightjs') ? "{ src: '#{revealjsdir}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }," : nil}
{ src: '#{revealjsdir}/plugin/zoom-js/zoom.js', async: true },
{ src: '#{revealjsdir}/plugin/notes/notes.js', async: true }
]
{ src: '#{revealjsdir}/plugin/notes/notes.js', async: true },
{ src: '#{revealjsdir}/plugin/print-pdf/print-pdf.js', async: true } ,
#{(attr? 'revealjs_plugins_add') ? File.read(attr('revealjs_plugins_add', '')) : ""}
],

#{(attr? 'revealjs_plugins_setup') ? File.read(attr('revealjs_plugins_setup', '')) : ""}

});
- unless (docinfo_content = (docinfo :footer, '.html')).empty?
=docinfo_content