summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/response.js2
-rw-r--r--public/css/slide.css13
-rw-r--r--public/js/slide.js24
-rw-r--r--public/views/slide.ejs2
4 files changed, 37 insertions, 4 deletions
diff --git a/lib/response.js b/lib/response.js
index 9df2ee9f..5c5798c8 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -555,7 +555,7 @@ function showPublishSlide(req, res, next) {
title: title,
description: meta.description,
slides: slides,
- slideOptions: JSON.stringify(meta.slideOptions || {}),
+ meta: JSON.stringify(obj.meta || {}),
GA: meta.GA,
useCDN: config.usecdn
};
diff --git a/public/css/slide.css b/public/css/slide.css
index 195981b3..40bb6ea1 100644
--- a/public/css/slide.css
+++ b/public/css/slide.css
@@ -252,4 +252,15 @@ pre.mermaid > svg {
.reveal .slides > section,
.reveal .slides > section > section {
transform-style: flat;
-} \ No newline at end of file
+}
+
+.reveal.rtl .slides,
+.reveal.rtl .slides h1,
+.reveal.rtl .slides h2,
+.reveal.rtl .slides h3,
+.reveal.rtl .slides h4,
+.reveal.rtl .slides h5,
+.reveal.rtl .slides h6 {
+ direction: rtl;
+ font-family: inherit;
+}
diff --git a/public/js/slide.js b/public/js/slide.js
index 996610fb..fe3cb1e8 100644
--- a/public/js/slide.js
+++ b/public/js/slide.js
@@ -45,7 +45,29 @@ var defaultOptions = {
};
// options from yaml meta
-var options = JSON.parse($("#options").text());
+var meta = JSON.parse($("#meta").text());
+var options = meta.slideOptions || {};
+
+var view = $('.reveal');
+
+//text language
+if (meta.lang && typeof meta.lang == "string") {
+ view.attr('lang', meta.lang);
+} else {
+ view.removeAttr('lang');
+}
+//text direction
+if (meta.dir && typeof meta.dir == "string" && meta.dir == "rtl") {
+ options.rtl = true;
+} else {
+ options.rtl = false;
+}
+//breaks
+if (typeof meta.breaks === 'boolean' && !meta.breaks) {
+ md.options.breaks = false;
+} else {
+ md.options.breaks = true;
+}
// options from URL query string
var queryOptions = Reveal.getQueryHash() || {};
diff --git a/public/views/slide.ejs b/public/views/slide.ejs
index 5817a200..8a8fbae0 100644
--- a/public/views/slide.ejs
+++ b/public/views/slide.ejs
@@ -50,7 +50,7 @@
<div class="slides"><%- slides %></div>
</div>
- <div id="options" class="hidden"><%- slideOptions %></div>
+ <div id="meta" style="display: none;"><%- meta %></div>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }});