From 862588a9eec7758bf103b99406417ef824442e8c Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Mon, 9 Dec 2019 10:39:47 +0100 Subject: [PATCH 1/4] require the local converter Otherwise the generated files are suffixed with .revealjs when using bundle exec rake examples:convert --- Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Rakefile b/Rakefile index 29ca2f30..414f5aaf 100644 --- a/Rakefile +++ b/Rakefile @@ -107,6 +107,7 @@ namespace :examples do # converted slides will be put in examples/ directory task :convert do require 'slim-htag' + require_relative 'lib/asciidoctor-revealjs' Dir.glob('examples/*.adoc') do |_file| print "Converting file #{_file}... " out = Asciidoctor.convert_file _file, From 1222b00684628d9aa8286732351440524153723f Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Mon, 9 Dec 2019 09:08:24 +0100 Subject: [PATCH 2/4] resolves #261 use the new syntax highlighter API introduced in Asciidoctor 2.0.0 --- examples/source-rouge.adoc | 41 +++ lib/asciidoctor-revealjs.rb | 2 + lib/asciidoctor-revealjs/highlightjs.rb | 41 +++ templates/asciidoctor_revealjs.css.slim | 13 + templates/document.html.slim | 26 +- templates/listing.html.slim | 52 ++-- test/doctest/colist.html | 18 +- test/doctest/document.html | 322 +++++++++++++------- test/doctest/listing.html | 58 +++- test/doctest/multi-destination-content.html | 16 +- test/doctest/source-callouts.html | 12 +- test/doctest/source-highlightjs-html.html | 12 +- test/doctest/source-highlightjs.html | 12 +- test/doctest/source-prettify.html | 6 +- test/doctest/source-rouge.html | 12 + test/doctest/theme-custom.html | 26 +- 16 files changed, 464 insertions(+), 205 deletions(-) create mode 100644 examples/source-rouge.adoc create mode 100644 lib/asciidoctor-revealjs/highlightjs.rb create mode 100644 test/doctest/source-rouge.html diff --git a/examples/source-rouge.adoc b/examples/source-rouge.adoc new file mode 100644 index 00000000..9640d992 --- /dev/null +++ b/examples/source-rouge.adoc @@ -0,0 +1,41 @@ +// .source-rouge +// Demonstration of source highlighting with Rouge +// :include: //div[@class="slides"] +// :header_footer: += Source Code with Rouge +:icons: font +:source-highlighter: rouge +:rouge-style: monokai + +== Requirements + +WARNING: This will not work from Asciidoctor.js + +[NOTE] +==== +For this to work. You need to add: + + gem 'rouge' + +to your `Gemfile` and re-run: + + bundle install +==== + +== Use the Source + +[source, rust] +---- +fn main() { + println!("Hello World!"); +} +---- + +== Stretch the Source + +[source, rust, role="stretch"] +---- +fn main() { + println!("Hello stretched World!"); +} +---- diff --git a/lib/asciidoctor-revealjs.rb b/lib/asciidoctor-revealjs.rb index 79a5343a..c8c2c6c4 100644 --- a/lib/asciidoctor-revealjs.rb +++ b/lib/asciidoctor-revealjs.rb @@ -1,8 +1,10 @@ if RUBY_ENGINE == 'opal' require 'asciidoctor-revealjs/converter' require 'asciidoctor-revealjs/version' + require 'asciidoctor-revealjs/highlightjs' else require 'asciidoctor' unless defined? Asciidoctor::Converter require_relative 'asciidoctor-revealjs/converter' require_relative 'asciidoctor-revealjs/version' + require_relative 'asciidoctor-revealjs/highlightjs' end diff --git a/lib/asciidoctor-revealjs/highlightjs.rb b/lib/asciidoctor-revealjs/highlightjs.rb new file mode 100644 index 00000000..aeb39dbe --- /dev/null +++ b/lib/asciidoctor-revealjs/highlightjs.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +module Asciidoctor + module Revealjs + module SyntaxHighlighter + # Override the built-in highlight.js syntax highlighter + class HighlightJsAdapter < Asciidoctor::SyntaxHighlighter::Base + register_for 'highlightjs', 'highlight.js' + + def initialize *args + super + @name = @pre_class = 'highlightjs' + end + + def format node, lang, opts + super node, lang, (opts.merge transform: proc { |_, code| + code['class'] = %(language-#{lang || 'none'} hljs) + code['data-noescape'] = true + }) + end + + def docinfo? location + location == :footer + end + + def docinfo location, doc, opts + if RUBY_ENGINE == 'opal' && JAVASCRIPT_PLATFORM == 'node' + revealjsdir = (doc.attr :revealjsdir, 'node_modules/reveal.js') + else + revealjsdir = (doc.attr :revealjsdir, 'reveal.js') + end + if doc.attr? 'highlightjs-theme' + theme_href = doc.attr 'highlightjs-theme' + else + theme_href = "#{revealjsdir}/lib/css/zenburn.css" + end + %() + end + end + end + end +end diff --git a/templates/asciidoctor_revealjs.css.slim b/templates/asciidoctor_revealjs.css.slim index 345a3ab6..9c99dcee 100644 --- a/templates/asciidoctor_revealjs.css.slim +++ b/templates/asciidoctor_revealjs.css.slim @@ -4,6 +4,19 @@ css: float: right; } + .reveal .listingblock.stretch > .content { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre > code { + height: 100%; + max-height: 100%; + } + /* callouts */ .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} diff --git a/templates/document.html.slim b/templates/document.html.slim index 15711d93..9058c7ed 100644 --- a/templates/document.html.slim +++ b/templates/document.html.slim @@ -12,6 +12,7 @@ html lang=(attr :lang, 'en' unless attr? :nolang) - [:description, :keywords, :author, :copyright].each do |key| - if attr? key meta name=key content=(attr key) + - linkcss = (attr? 'linkcss') title=(doctitle sanitize: true, use_fallback: true) meta content="yes" name="apple-mobile-web-app-capable" meta content="black-translucent" name="apple-mobile-web-app-status-bar-style" @@ -46,24 +47,10 @@ html lang=(attr :lang, 'en' unless attr? :nolang) TeX: {#{eqnums_opt}} }); script src='#{cdn_base}/mathjax/2.4.0/MathJax.js?config=TeX-MML-AM_HTMLorMML' - - case document.attr 'source-highlighter' - - when 'coderay' - - if (attr 'coderay-css', 'class') == 'class' - - if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss) - link rel='stylesheet' href=normalize_web_path('asciidoctor-coderay.css', (attr :stylesdir, '')) - - else - style=Asciidoctor::Stylesheets.instance.coderay_stylesheet_data - - when 'pygments' - - if (attr 'pygments-css', 'class') == 'class' - - if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss) - link rel='stylesheet' href=normalize_web_path('asciidoctor-pygments.css', (attr :stylesdir, '')) - - else - style=Asciidoctor::Stylesheets.instance.pygments_stylesheet_data(attr 'pygments-style') - / For syntax highlighting - - if attr? 'highlightjs-theme' - link href=(attr 'highlightjs-theme') rel="stylesheet" - - else - link href="#{revealjsdir}/lib/css/zenburn.css" rel="stylesheet" + + - syntax_hl = self.syntax_highlighter + - if syntax_hl && (syntax_hl.docinfo? :head) + =syntax_hl.docinfo :head, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/' / If the query includes 'print-pdf', use the PDF print sheet javascript: var link = document.createElement( 'link' ); @@ -250,5 +237,8 @@ html lang=(attr :lang, 'en' unless attr? :nolang) #{(attr? 'revealjs_plugins_configuration') ? File.read(attr('revealjs_plugins_configuration', '')) : ""} }); + - if syntax_hl && (syntax_hl.docinfo? :footer) + =syntax_hl.docinfo :footer, self, cdn_base_url: cdn_base, linkcss: linkcss, self_closing_tag_slash: '/' + - unless (docinfo_content = (docinfo :footer, '.html')).empty? =docinfo_content diff --git a/templates/listing.html.slim b/templates/listing.html.slim index 5185cbda..57c6cdfd 100644 --- a/templates/listing.html.slim +++ b/templates/listing.html.slim @@ -1,35 +1,19 @@ -- if title? - .title=captioned_title -- nowrap = !(@document.attr? :prewrap) || (option? 'nowrap') -/ implicit listing blocks and source blocks are rendered as code -/ explicit listing blocks stay listing -- if @style == 'source' || (@style == 'listing' && attributes[1] != 'listing') - - language = attr :language - - code_class = language ? [language, "language-#{language}"] : nil - - pre_class = ['highlight'] - - pre_lang = nil - - code_noescape = false - - case document.attr 'source-highlighter' - - when 'coderay' - - pre_class = ['CodeRay'] - - when 'pygments' - - pre_class = ['pygments','highlight'] - - when 'prettify' - - pre_class = ['prettyprint'] - - pre_class << 'linenums' if attr? :linenums - - pre_class << language if language - - pre_class << "language-#{language}" if language - - code_class = nil - - when 'html-pipeline' - - pre_lang = language - - pre_class = code_class = nil - - nowrap = false - - when 'highlightjs', 'highlight.js' - - code_noescape=true - - pre_class << 'nowrap' if nowrap - - pre_class << 'listingblock' - - pre_class << role if role - pre class=pre_class lang=pre_lang id=@id - code data-noescape=code_noescape class=code_class =content +- nowrap = (option? 'nowrap') || !(document.attr? 'prewrap') +- syntax_hl = document.syntax_highlighter +- if @style == 'source' + - lang = attr :language + - if syntax_hl + - doc_attrs = document.attributes + - css_mode = (doc_attrs[%(#{syntax_hl.name}-css)] || :class).to_sym + - style = doc_attrs[%(#{syntax_hl.name}-style)] + - opts = syntax_hl.highlight? ? { css_mode: css_mode, style: style } : {} + - opts[:nowrap] = nowrap + - else + - pre_open = %(
)
+    - pre_close = '
' - else - pre class=(nowrap ? 'nowrap' : nil) =content + - pre_open = %() + - pre_close = '' +- id_attribute = id ? %( id="#{id}") : '' +- title_element = title? ? %(
#{captioned_title}
\n) : '' +=%(#{title_element}
#{syntax_hl ? (syntax_hl.format self, lang, opts) : pre_open + (content || '') + pre_close}
) diff --git a/test/doctest/colist.html b/test/doctest/colist.html index c1789c31..08cae54a 100644 --- a/test/doctest/colist.html +++ b/test/doctest/colist.html @@ -1,9 +1,13 @@ -
require 'sinatra' (1)
+
+
+
require 'sinatra' (1)
 
 get '/hi' do  (2)
   "Hello World!" (3)
 end
+
+
  1. @@ -19,11 +23,15 @@
-
require 'sinatra' (1)
+
+
+
require 'sinatra' (1)
 
 get '/hi' do  (2)
   "Hello World!" (3)
 end
+
+
Description
    @@ -40,11 +48,15 @@
-
require 'sinatra' (1)
+
+
+
require 'sinatra' (1)
 
 get '/hi' do  (2)
   "Hello World!" (3)
 end
+
+
  1. diff --git a/test/doctest/document.html b/test/doctest/document.html index 96ec1c0c..609ed346 100644 --- a/test/doctest/document.html +++ b/test/doctest/document.html @@ -32,7 +32,20 @@

    The Dangerous and Thrilling Documentation Chronicles

    .reveal div.right { float: right; } - + + .reveal .listingblock.stretch > .content { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre > code { + height: 100%; + max-height: 100%; + } + /* callouts */ .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} @@ -42,7 +55,6 @@

    The Dangerous and Thrilling Documentation Chronicles

    b.conum *{color:inherit!important} .conum:not([data-value]):empty{display:none} - @@ -218,7 +230,20 @@

    The Dangerous and Thrilling Documentation Chronicles

    .reveal div.right { float: right; } - + + .reveal .listingblock.stretch > .content { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre > code { + height: 100%; + max-height: 100%; + } + /* callouts */ .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} @@ -228,7 +253,6 @@

    The Dangerous and Thrilling Documentation Chronicles

    b.conum *{color:inherit!important} .conum:not([data-value]):empty{display:none} - @@ -404,7 +428,20 @@

    The Dangerous and Thrilling Documentation Chronicles

    .reveal div.right { float: right; } - + + .reveal .listingblock.stretch > .content { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre > code { + height: 100%; + max-height: 100%; + } + /* callouts */ .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} @@ -414,7 +451,6 @@

    The Dangerous and Thrilling Documentation Chronicles

    b.conum *{color:inherit!important} .conum:not([data-value]):empty{display:none} - @@ -590,7 +626,20 @@

    Document Title

    .reveal div.right { float: right; } - + + .reveal .listingblock.stretch > .content { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre > code { + height: 100%; + max-height: 100%; + } + /* callouts */ .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} @@ -600,7 +649,6 @@

    Document Title

    b.conum *{color:inherit!important} .conum:not([data-value]):empty{display:none} - @@ -776,7 +824,20 @@

    Document Title

    .reveal div.right { float: right; } - + + .reveal .listingblock.stretch > .content { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre > code { + height: 100%; + max-height: 100%; + } + /* callouts */ .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} @@ -786,7 +847,6 @@

    Document Title

    b.conum *{color:inherit!important} .conum:not([data-value]):empty{display:none} - @@ -961,7 +1021,20 @@

    Document Title

    .reveal div.right { float: right; } - + + .reveal .listingblock.stretch > .content { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre > code { + height: 100%; + max-height: 100%; + } + /* callouts */ .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} @@ -971,7 +1044,6 @@

    Document Title

    b.conum *{color:inherit!important} .conum:not([data-value]):empty{display:none} - @@ -1148,7 +1220,20 @@

    Document Title

    .reveal div.right { float: right; } - + + .reveal .listingblock.stretch > .content { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre > code { + height: 100%; + max-height: 100%; + } + /* callouts */ .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} @@ -1158,7 +1243,6 @@

    Document Title

    b.conum *{color:inherit!important} .conum:not([data-value]):empty{display:none} - @@ -1335,7 +1419,20 @@

    Cavern Glow

    .reveal div.right { float: right; } - + + .reveal .listingblock.stretch > .content { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre { + height: 100%; + } + + .reveal .listingblock.stretch > .content > pre > code { + height: 100%; + max-height: 100%; + } + /* callouts */ .conum[data-value] {display:inline-block;color:#fff!important;background-color:rgba(50,150,50,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} .conum[data-value] *{color:#fff!important} @@ -1345,7 +1442,6 @@

    Cavern Glow

    b.conum *{color:inherit!important} .conum:not([data-value]):empty{display:none} - diff --git a/test/doctest/listing.html b/test/doctest/listing.html index 8a396d03..f1e04058 100644 --- a/test/doctest/listing.html +++ b/test/doctest/listing.html @@ -1,40 +1,70 @@ -
    echo -n "Please enter your name: "
    +
    +
    +
    echo -n "Please enter your name: "
     read name
    -echo "Hello, $name!"
    +echo "Hello, $name!"
    +
+ -
Reading user input
-
echo -n "Please enter your name: "
+
+
Reading user input
+
+
echo -n "Please enter your name: "
 read name
-echo "Hello, $name!"
+echo "Hello, $name!"
+ + -
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+
+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+
-
echo -n "Please enter your name: "
+
+
+
echo -n "Please enter your name: "
 read name
-echo "Hello, $name!"
+echo "Hello, $name!"
+ + -
5.times do
+
+
+
5.times do
   print "Odelay!"
 end
+
+
-
Odelay!
-
5.times do
+
+
Odelay!
+
+
5.times do
   print "Odelay!"
 end
+
+
-
5.times do
+
+
+
5.times do
   print "Odelay!"
 end
+
+
-
public class ApplicationConfigurationProvider extends HttpConfigurationProvider {
+
+
+
public class ApplicationConfigurationProvider extends HttpConfigurationProvider {
 
    public Configuration getConfiguration(ServletContext context) {
       return ConfigurationBuilder.begin()
@@ -44,3 +74,5 @@
                .where("path").matches(".*");
    }
 }
+
+
diff --git a/test/doctest/multi-destination-content.html b/test/doctest/multi-destination-content.html index 0d8882f0..2fef86c8 100644 --- a/test/doctest/multi-destination-content.html +++ b/test/doctest/multi-destination-content.html @@ -45,7 +45,9 @@

Sub Section lvl 3

Some overview

-
+-------------------------------------------------+
+      
+
+
+-------------------------------------------------+
 |       Big Picture                               |
 | +-------------+  +-----------+  +-------------+ |
 | |             |  |           |  |             | |
@@ -61,13 +63,17 @@ 

Sub Section lvl 3

| | | | | | | | | +-------------+ +-----------+ +-------------+ | | | -+-------------------------------------------------+
++-------------------------------------------------+
+ +

Detailed view

-
+---------------------------------------------------+
+      
+
+
+---------------------------------------------------+
 |   +---------------------------------------------+ |
 |   |     |      |             |                  | |
 |   |     |      |             |                  | |
@@ -75,7 +81,9 @@ 

Sub Section lvl 3

| | | | IMPORTANT | | | | | | | DATA | | | | +---------------------------------------------+ | -+---------------------------------------------------+
++---------------------------------------------------+
+ +
diff --git a/test/doctest/source-callouts.html b/test/doctest/source-callouts.html index 47a9e8c7..e4e322d1 100644 --- a/test/doctest/source-callouts.html +++ b/test/doctest/source-callouts.html @@ -5,9 +5,13 @@

Source code callouts

Callout

-
fn main() {
+    
+
+
fn main() {
     println!("Hello World!"); (1)
 }
+
+
@@ -22,9 +26,13 @@

Callout

Stretched Callout

-
fn main() { (1)
+    
+
+
fn main() { (1)
     println!("Hello World!"); (2)
 }
+
+
diff --git a/test/doctest/source-highlightjs-html.html b/test/doctest/source-highlightjs-html.html index 5df7f1a1..f31c1e65 100644 --- a/test/doctest/source-highlightjs-html.html +++ b/test/doctest/source-highlightjs-html.html @@ -5,11 +5,19 @@

HTML Source Code with Highlight.JS

Use the Source

-
<b>This should be source code and not bold</b>
+
+
+
<b>This should be source code and not bold</b>
+
+

Callouts

-
<b>complex code</b> (1)
+
+
+
<b>complex code</b> (1)
+
+
diff --git a/test/doctest/source-highlightjs.html b/test/doctest/source-highlightjs.html index 5386e1f9..833c8eda 100644 --- a/test/doctest/source-highlightjs.html +++ b/test/doctest/source-highlightjs.html @@ -5,14 +5,22 @@

Source Code with Highlight.JS

Use the Source

-
fn main() {
+    
+
+
fn main() {
     println!("Hello World!");
 }
+
+

Stretch the Source

-
fn main() {
+    
+
+
fn main() {
     println!("Hello stretched World!");
 }
+
+
diff --git a/test/doctest/source-prettify.html b/test/doctest/source-prettify.html index b2c49fe9..39ab32c8 100644 --- a/test/doctest/source-prettify.html +++ b/test/doctest/source-prettify.html @@ -5,8 +5,12 @@

Source Code with Prettify

Use the Source

-
fn main() {
+    
+
+
fn main() {
     println!("Hello World!");
 }
+
+
diff --git a/test/doctest/source-rouge.html b/test/doctest/source-rouge.html new file mode 100644 index 00000000..b2c49fe9 --- /dev/null +++ b/test/doctest/source-rouge.html @@ -0,0 +1,12 @@ + +
+
+

Source Code with Prettify

+
+
+

Use the Source

+
fn main() {
+    println!("Hello World!");
+}
+
+
diff --git a/test/doctest/theme-custom.html b/test/doctest/theme-custom.html index d81dbfea..e03621e6 100644 --- a/test/doctest/theme-custom.html +++ b/test/doctest/theme-custom.html @@ -1,5 +1,5 @@ - +

OWASP Theme

@@ -41,7 +41,7 @@

Actually, they are…​

slide.style.backgroundColor = 'transparent'; } }) - + // See https://github.com/hakimel/reveal.js#configuration for a full list of configuration options Reveal.initialize({ // Display presentation control arrows @@ -133,16 +133,16 @@

Actually, they are…​

parallaxBackgroundVertical: null, // The display mode that will be used to show slides display: 'block', - + // The "normal" size of the presentation, aspect ratio will be preserved // when the presentation is scaled to fit different resolutions. Can be // specified using percentage units. width: 1280, height: 720, - + // Factor of the display size that should remain empty around the content margin: 0.1, - + // Bounds for smallest/largest possible scale to apply to content minScale: 0.2, maxScale: 1.5, @@ -156,16 +156,16 @@

Actually, they are…​

// Optional libraries used to extend on reveal.js dependencies: [ { src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } }, - + { src: 'reveal.js/plugin/zoom-js/zoom.js', async: true }, { src: 'reveal.js/plugin/notes/notes.js', async: true }, - - - - + + + + ], - - - + + + }); From 464263e8e35b5b802f294ce8f2d913619bee4b62 Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Tue, 10 Dec 2019 09:30:28 +0100 Subject: [PATCH 3/4] Add rouge and pygments.rb as development dependencies to render examples --- asciidoctor-revealjs.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/asciidoctor-revealjs.gemspec b/asciidoctor-revealjs.gemspec index fa24d2d1..9212a18e 100644 --- a/asciidoctor-revealjs.gemspec +++ b/asciidoctor-revealjs.gemspec @@ -43,6 +43,8 @@ Gem::Specification.new do |s| s.add_development_dependency 'asciidoctor-templates-compiler', '~> 0.4.2' s.add_development_dependency 'slim', '~> 3.0.6' s.add_development_dependency 'slim-htag', '~> 0.1.0' + s.add_development_dependency 'rouge' + s.add_development_dependency 'pygments.rb' # Overriden in Gemfile and Gemfile.upstream for now #s.add_development_dependency 'opal', '~> 0.11.1' end From 5b352091145c858c628d7b3052d96b175d0ef773 Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Tue, 10 Dec 2019 16:58:57 +0100 Subject: [PATCH 4/4] Pygments does not work with JRuby and Python 3 --- asciidoctor-revealjs.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asciidoctor-revealjs.gemspec b/asciidoctor-revealjs.gemspec index 9212a18e..ce98b683 100644 --- a/asciidoctor-revealjs.gemspec +++ b/asciidoctor-revealjs.gemspec @@ -38,13 +38,13 @@ Gem::Specification.new do |s| s.add_development_dependency 'pry', '~> 0.10.4' if RUBY_ENGINE != 'jruby' s.add_development_dependency 'pry-byebug' + s.add_development_dependency 'pygments.rb' end s.add_development_dependency 'colorize' s.add_development_dependency 'asciidoctor-templates-compiler', '~> 0.4.2' s.add_development_dependency 'slim', '~> 3.0.6' s.add_development_dependency 'slim-htag', '~> 0.1.0' s.add_development_dependency 'rouge' - s.add_development_dependency 'pygments.rb' # Overriden in Gemfile and Gemfile.upstream for now #s.add_development_dependency 'opal', '~> 0.11.1' end