rstudio/revealjs

support for reveal multiplexing

edavidaja opened this issue · 1 comments

I'm trying to set up multiplexing for my reveal slides. I set the following yaml header,

---
output:
  revealjs::revealjs_presentation:
    mathjax: null
    css: custom.css
    transition: fade
    theme: night
    self_contained: false
    reveal_plugins: ["notes"]
    reveal_options:
      width: 100%
      height: 100%
      multiplex:
        secret: !expr Sys.getenv("REVEAL_SECRET")
        id: df4365f794f4570c
        url: 'https://reveal-multiplex.glitch.me/'
      dependencies:
        - {src: 'https://reveal-multiplex.glitch.me/socket.io/socket.io.js', async: true}
        - {src: 'https://reveal-multiplex.glitch.me/master.js', async: true}
        - {src: 'https://unpkg.com/reveal-notes-server/client.js', async: true}
resource_files:
- custom.css

which fails to render with the following error:

/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS index.knit.md --to revealjs --from markdown+autolink_bare_uris+tex_math_single_backslash-implicit_figures --output index.html --lua-filter /Users/edavidaja/Documents/projects/rstudio-helm-charts/renv/library/R-4.1/x86_64-apple-darwin17.0/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Users/edavidaja/Documents/projects/rstudio-helm-charts/renv/library/R-4.1/x86_64-apple-darwin17.0/rmarkdown/rmarkdown/lua/latex-div.lua --template "/Users/edavidaja/Library/Application Support/renv/cache/v5/R-4.1/x86_64-apple-darwin17.0/revealjs/0.9/08e30caa337e6d335d83df1a05d5b9f3/revealjs/rmarkdown/templates/revealjs_presentation/resources/default.html" --variable center=false --slide-level 2 --variable theme-dark --variable theme=night --variable transition=fade --variable backgroundTransition=default --variable history=true --variable "width='100%'" --variable "height='100%'" --variable multiplex=1629389494336663164 multiplex=df4365f794f4570c "multiplex=https://reveal-multiplex.glitch.me/" --variable "dependencies=list(src = \"https://reveal-multiplex.glitch.me/socket.io/socket.io.js\", async = TRUE)" "dependencies=list(src = \"https://reveal-multiplex.glitch.me/master.js\", async = TRUE)" "dependencies=list(src = \"https://unpkg.com/reveal-notes-server/client.js\", async = TRUE)" --variable plugin-notes=1 --css custom.css --include-in-header /var/folders/dl/v1xk8hbj7fl7r_hrc40_4f800000gn/T//Rtmpsp2DMc/rmarkdown-str17cb65a1a791.html --variable revealjs-url=index_files/reveal.js-3.3.0.1 --highlight-style pygments 
pandoc: multiplex=df4365f794f4570c: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1
cderv commented

For future references, some notes:

  • Pandoc template for revealjs does not allow to add anything else than supported in Reveal.initialize, meaning only the list of options from https://revealjs.com/config/, and supported included pluggins.

  • In this package, we are using a custom template and we have added support for some more options, through pluggins
    Example:

    // Optional reveal.js plugins
    dependencies: [
    $if(plugin-notes)$
    { src: '$revealjs-url$/plugin/notes/notes.js', async: true },
    $endif$
    $if(plugin-search)$
    { src: '$revealjs-url$/plugin/search/search.js', async: true },
    $endif$
    $if(plugin-zoom)$
    { src: '$revealjs-url$/plugin/zoom-js/zoom.js', async: true },
    $endif$
    $if(plugin-chalkboard)$
    { src: '$revealjs-url$/plugin/chalkboard/chalkboard.js', async: true },
    $endif$
    $if(plugin-menu)$
    { src: '$revealjs-url$/plugin/menu/menu.js', async: true },
    $endif$
    ]

    $if(plugin-chalkboard)$
    chalkboard: {
    $if(chalkboard-src)$
    src: $chalkboard-src$,
    $endif$
    $if(chalkboard-readOnly)$
    readOnly: $chalkboard-readOnly$,
    $endif$
    $if(chalkboard-toggleNotesButton)$
    toggleNotesButton: $chalkboard-toggleNotesButton$,
    $endif$
    $if(chalkboard-toggleChalkboardButton)$
    toggleChalkboardButton: $chalkboard-toggleChalkboardButton$,
    $endif$
    $if(chalkboard-transition)$
    transition: $chalkboard-transition$,
    $endif$
    $if(chalkboard-theme)$
    theme: $chalkboard-theme$,
    $endif$
    $if(chalkboard-color)$
    color: $chalkboard-color$,
    $endif$
    $if(chalkboard-background)$
    background: $chalkboard-background$,
    $endif$
    $if(chalkboard-pen)$
    pen: $chalkboard-pen$,
    $endif$
    },

  • So currently, there is no mechanism for adding an external plugging and new options.

We could:

  • Bring support in the package for multiplex
  • Change the mechanism to allow adding any content to Reveal.initialize though YAML header.