diff --git a/lib/response.js b/lib/response.js index 9df2ee9..5c5798c 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 195981b..40bb6ea 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 996610f..fe3cb1e 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 5817a20..8a8fbae 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -50,7 +50,7 @@
-