From 0569194ee4db045fc333f7f47f22c31f352dc972 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Tue, 3 Jul 2018 13:49:09 -0400 Subject: [PATCH 1/3] Fix rendering of reveal options --- _layouts/reveal.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_layouts/reveal.html b/_layouts/reveal.html index 2e9a974..cd5fad6 100644 --- a/_layouts/reveal.html +++ b/_layouts/reveal.html @@ -8,8 +8,7 @@ - - + @@ -69,8 +68,9 @@ transition: '{{ site.reveal_transition }}', // default/cube/page/concave/zoom/linear/fade/none {% if site.reveal_options %} - - {{ site.reveal_options | append:',' }} + {% for option in site.reveal_options %} + {{ option[0] }}: "{{ option[1] }}", + {% endfor %} {% endif %} From 882c5f3f042396eb21d8889a93032f5df5a97f6d Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Tue, 10 Jul 2018 08:45:05 -0400 Subject: [PATCH 2/3] Allow options as both list-of-strings or mapping --- _layouts/reveal.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/_layouts/reveal.html b/_layouts/reveal.html index cd5fad6..66d1494 100644 --- a/_layouts/reveal.html +++ b/_layouts/reveal.html @@ -68,10 +68,15 @@ transition: '{{ site.reveal_transition }}', // default/cube/page/concave/zoom/linear/fade/none {% if site.reveal_options %} - {% for option in site.reveal_options %} - {{ option[0] }}: "{{ option[1] }}", - {% endfor %} - + {% if site.reveal_options.first.first %} + // Reveal options generated from mapping + {% for option in site.reveal_options %} + {{ option[0] }}: "{{ option[1] }}", + {% endfor %} + {% else %} + // Reveal options generated from a list of strings + {{ site.reveal_options | append:',' }} + {% endif %} {% endif %} // Optional libraries used to extend on reveal.js From 9ced54d2d9e6ea0a8a5a9ebe71d058264412ed37 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Tue, 10 Jul 2018 08:49:45 -0400 Subject: [PATCH 3/3] Update reveal_options documentation --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 99c6bde..78615f4 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ You can configure almost any reveal.js setting using the _config.yml-settings fi * reveal_theme_path: The path to the reveal.js-theme (can be changed for custom themes) [reveal.js/css/theme/] * reveal_notes_server: Wether to support the speaker notes server [false (only local speaker notes)] * reveal_options: Additional reveal.js [options][] + * reveal_dependencies: Additional reveal.js [dependencies][] * reveal_path: Path to the reveal.js-installation [reveal.js] @@ -64,6 +65,39 @@ You can also further customize the presentation: * extra_css: Additional CSS files added after the reveal theme [] * highlight_style_sheet: CSS theme for highlight.js [reveal.js/lib/css/zenburn.css] +### Specifying reveal options and dependencies + +`reveal_options` can be either a list of strings specifying the Javascript options, e.g.: + +```yaml +reveal_options: + - 'width: "960px"' + - 'height: "720px"' +``` + +or, as a convenience, it can be a mapping of options to their values: + +```yaml +reveal_options: + width: 960px + height: 720px +``` + +Note that if a mapping is passed, the values will be inserted into the +final javascript as quoted strings. If this is unacceptable (for example, +if you want to pass a boolean parameter that takes `true` or `false`), +specify a list of strings. + +`reveal_dependencies` takes a list of strings representing the javascript +to specify a dependency [as you would in reveal.js](https://github.com/hakimel/reveal.js/#dependencies), +for example: + +```yaml +reveal_dependencies: + # Speaker notes + - "{ src: 'path/to/plugin.js', async: true }," +``` + ## Custom reveal.js-themes If you want to use your custom reveal.js-theme, we recommend adding a directory "theme", putting the file(s)