Code Monkey home page Code Monkey logo

rmdshower's Introduction

rmdshower

R Markdown Template for the Shower Presentation Engine

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Linux Build Status CRAN RStudio mirror downloads

Installation

devtools::install_github("mangothecat/rmdshower")

Usage

Use the rmdshower::shower format in the Rmd header, and then just call rmarkdown::render() as usual:

---
title: "Shower Presentations with R Markdown"
author: "Gábor Csárdi"
output:
  rmdshower::shower_presentation:
    self_contained: false
    katex: true
    ratio: 16x10
---

More information

License

MIT © Mango Solutions, R Studio, Vadim Makeev

rmdshower's People

Contributors

cderv avatar dougmet avatar gaborcsardi avatar lmullen avatar seaaan avatar yihui avatar zeehio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rmdshower's Issues

consider naming the format shower_presentation

Within the RStudio Preview we have some special behavior that is triggered if we know a format is a Presentation:

  1. We automatically restore the HTML Preview to the last viewed anchor tag (i.e. last viewed slide);
  2. We provide a slightly wider preview window (relative to the hight)

Note that in the current release of RStudio we always do #1 (restore the anchor) however in the upcoming release we'll be looking for the _presentation suffix to trigger this, see: https://github.com/rstudio/rstudio/blob/f2860cf04082e54561102803e46e92aac9276152/src/gwt/src/org/rstudio/studio/client/rmarkdown/model/RmdRenderResult.java#L98-L102

If you have strong reasons for keeping the name shower then we can certainly hard-code that format to also restore the last viewed slide. Let me know what you think.

Standalone option fails to knit

Here's the output block in my yaml header:

output: 
  rmdshower::shower_presentation:
    self_contained: true
    theme: "material"
    incremental: true
    katex: true
    ratio: "4x3"

This returns the following error when knitting:

pandoc.exe: Could not fetch slides_files/rmdshower/package/styles/screen-4x3.css
slides_files/rmdshower/package/styles/screen-4x3.css: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 67
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS slides.utf8.md --to revealjs --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output slides.html --smart --email-obfuscation none --self-contained --template "C:\RLibrary\rmdshower\rmarkdown\templates\shower\resources\default.html" --incremental --slide-level 2 "--variable=ratio:4x3" "--variable=katex:yes" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" "--variable=shower-url:slides_files\rmdshower" "--variable=theme:material" "--variable=shower-theme-url:slides_files/rmdshower" --highlight-style pygments' had status 67 
Execution halted

Cannot Install for Missing rprojroot Package

Since the installation fails if rprojroot package is not present I suggest adding it into the dependencies to install.
Log:
Installing rmdshower "C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \ "C:/Users/me/AppData/Local/Temp/RtmpsnEWXI/devtools28c043cf7d31/MangoTheCat-rmdshower-cbe203c" \ --library="C:/Program Files/R/R-3.3.2/library" --install-tests

  • installing source package 'rmdshower' ...
    ** R
    ** inst
    ** preparing package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    there is no package called 'rprojroot'
    ERROR: lazy loading failed for package 'rmdshower'
  • removing 'C:/Program Files/R/R-3.3.2/library/rmdshower'
    Error: Command failed (1)

shared directory for multiple presentations?

Thanks for the work on this!

Is there a way to have the directory of includes shared over multiple presentations? Suppose I have presentations a.Rmd, b.Rmd, c.Rmd, .... With the self_contained option set to false (it never works for me when set to true), this creates directories a_files, b_files, c_files, ... I suspect that all these directories are the same. Is there a way to just have one of them?

Specifying text at fixed position on a slide.

Hello,
is there a preferred way to position text/image at a fixed point on a slide? I normally write citations or other footnotes in bottom right corner. Thanks to this page:

https://www.uvm.edu/rsenr/vtcfwru/R/fledglings/14_Slideshows.html

I can do the following on a slide

## absolute positioning

<div style="font-size: 60%; position: absolute; right: 10%;   width: fit-content; height: fit-content; border:3px solid blue; top:90%; z-index:10">
Text goes here
</div>

but that's a lot of markup to repeat each time. I thought I could create my own div.absolute in a .css file, but this doesn't seem to put the text in the bottom right hand corner. What's missing?

## Version 2

<style>
div.myabsolute {
    font-size: 60%
    position: fixed;
    top: 90%;
    right: 10%;
    width: fit-content;
    height: fit-content;
    border: 1px solid #73AD21;
}
</style>

<div class="myabsolute">Wassle et al (1981)</div>

Thanks!

Adjusting title position on a slide.

I really like the ribbon style for making styles -- it seems quite clean, minimal. My main concern is that I think the title should be much higher on the slide -- otherwise, there is too much space at the top of the slide.

I have manually solved this problem by editing screen.css to reduce the padding on the slide, so that the relevant part of the .slide{} component reads

padding:46px 80px 0;width:1024px;height:768px

whereas before it was:

padding:106px 100px 0;width:1024px;height:768px

(I would ordinarily send a diff, but given the way these files are one long line, it seems hard to do so).

An example of the resulting slides can be found at: http://sje30.github.io/talks/2016/uknode.html

What is the preferred way to add our own customisations to the inbuilt styles?

elegant way to change ribbon color?

I see that if I change the fill attribute of the path tag in rmdshower/node_modules/shower-ribbon/images/ribbon.svg I can change the ribbon color. But is there a way that I can pass that attribute through the .Rmd file? Could a ribbon-color argument be added to shower_presentation()? Or is there a way to do this with CSS?

problem rendering skeleton.Rmd example

Hi,
I was giving a try to rmdshower which looks very promising, but I was not able to reproduce the default skeleton example.
A screenshot of the output html that I obtain is attached below.
Many thanks for any help.

Luca

> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.5 (El Capitan)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  utils     datasets  grDevices methods   base     

other attached packages:
[1] RColorBrewer_1.1-2

loaded via a namespace (and not attached):
 [1] magrittr_1.5       rsconnect_0.4.3    htmltools_0.3.5    tools_3.3.1        yaml_2.1.13        Rcpp_0.12.6       
 [7] stringi_1.1.1      rmarkdown_1.0.9002 rmdshower_2.0.0    stringr_1.1.0      digest_0.6.9       evaluate_0.9

shower_html

Got a hex logo?

I am giving a talk covering R Markdown and related tools and I would like to discuss rmdshower. I am trying to tag my slides with logo for the packages that are featured. I found a blue square shower logo but not a hex version that will work with the R Studio stickers (https://github.com/rstudio/hex-stickers). Do you have a hex logo? If so, can you add it to the repo?

Images not rendered

Hi there!

After upgrading R to ver. 3.5.0 and, consequently, the packages rmarkdown and rmdshower, I cannot render my own presentations created a few weeks ago. I get the following issue. The code in my source file:

![title](img/fig_3.png)

is rendered:

<p><img data-src="img/fig_5.png" alt="title"/></p>

rather than

<p><img src="img/fig_5.png" alt="title"/></p>

The issue affects the following setup:

  • macOS High Sierra 10.13.4
  • R version 3.5.0
  • rmarkdown_1.9

And it works flawlessly on a Linux machine, regardless of the upgrades:

  • Debian GNU/Linux 8 (jessie)
  • R version 3.3.3
  • rmarkdown_1.9

Knitting with a custom theme

Hello! Thank you so much for this beautiful presentation option; I love using it.

We have built an internal package at Stack Overflow with our styling, fonts, etc in much the same way that Mango has a theme package. To get our R Markdown files to knit, I had to add our package to the package.json on a fork of rmdshower and install that fork to my local machine. Without that, rmdshower does not know about my theme package and fails to knit.

What is going on here? Is this as intended? Should I submit a PR with our internal theme package listed?

Defaults and ari compatibility

In getting rmdshower to work with ari, I came across two small tweaks to options that I think would be useful:

  1. numbered anchors: Currently slides have title-based anchors (slides.html#introduction). I think numbered anchors are better for slideshows (slides.html#1), and for ari they are required to advance the slides. This can be changed by removing the auto_identifiers option from pandoc markdown. I would just make this default behavior.

  2. base presentation view: shower slides control whether default view is the overview of slides or the first slide by switching between <body class="shower list"> and <body class="shower full">. I would add an option to shower_presentation(), base_view, with "list" as default but also taking "full". ari also needs full view.

Happy to do a PR with these if you agree and are still maintaining the package.

`kableExtra::kable()` rendering of tables looks weird

I have this simple document:

---
title: "TEST"
author: TEST
output:
  rmdshower::shower_presentation:
    self_contained: false
    katex: true
    ratio: 16x10
---

##Slide with R Code and Output

library(dplyr)
head(iris) %>% kableExtra::kable()

but the output of the table looks really weird - for example lines between the rows extend to the whole width of the slide and some of the columns are "glued" to each other (there is no space between them). Is there some incompatibility between shower and kable?
image

Full-page title slide getting marked up with <h1> instead of <h2> with <class = "shout">

I noticed that full-page titles (indicated in Rmd with a single hashtag "#") does not get rendered as full-page text, as shown in the example HTML online. Having compared the markups, I see that in the correctly marked up HTML, the full-page titles are coded with

and <class = "shout">, whereas when I do it on my machine, they get coded with

without <class = "shout">.

I'm not sure if this package is actively being maintained and if there is an easy fix to this, but I've settled on manually changing the HTML after rendering to make the updates.

R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.3
rmdshower_2.1.1

Pause

With

. . .

It puts the rest of the slide (well, the part before the next . . . into a div with class fragment. So we could just have the appropriate CSS for it.

Clean up themes

They do not need the source font files, and common fonts should be included once only.

Rerelease on CRAN

This is a placeholder to remind me to tell @dougmet that we need to rerelease rmdshower on CRAN otherwise it doesn't work with the new rmdshower.mango theme - the CRAN release still uses the old theme.

Bullet in <li> incorrectly rendered in Chrome/mac

Hi,

I'm not quite sure where the error here is, but I thought I'd ask first here. My colleague @lgatto has made some nice slides at http://lgatto.github.io/Quantitative-Proteomics-and-Data-Analysis/slides.html

On my mac laptop, on page 6, the bullets are rendered incorrectly on Chrome, yet appear fine in Safari.
See screenshot here for the problem bullets in Chrome. I find the same problem with my own .Rmd file so I think there is an encoding issue somewhere, yet chrome Encoding reports it as UTF-8.
crazybullets

[edit: I see the same problem on Chrome/Android, so I don't think it is mac-specific.]

Any help?

Stephen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.