Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement Request: Allow for Themes in RNotebooks #864

Closed
jeff-mettel opened this issue Nov 10, 2016 · 7 comments
Closed

Enhancement Request: Allow for Themes in RNotebooks #864

jeff-mettel opened this issue Nov 10, 2016 · 7 comments

Comments

@jeff-mettel
Copy link

Background
The fantastic RNotebooks functionality automatically creates a .html file from an RMarkdown document. This HTML file can be shared with R programmers and non R-programmers alike, and include both raw code as well as an general narrative around the analysis being performed.

@yihui 's site describes how RMarkdown can be augmented to produce documents with an aesthetically pleasing theme.

Problem
It does not appear that RNotesbooks support this usage of themes.

Request
RNotebooks provide a tremendous methodology for dissemination of analytics. Ensuring they support themes in the generation of HTML output would be a fantastic addition.

@yihui
Copy link
Member

yihui commented Nov 10, 2016

Just a minor correction: that was not my site, but @yixuan's :)

@jjallaire
Copy link
Member

You can use the "theme" option as described by @yixuan in his post.

He goes on to describe how to create a more lightweight document that's
still attractive. If your goal is lightweight though then html_notebook is
anything but that (as it includes all code and output).

Hopefully what you are looking for is taken care of by the "theme" option
(most of the bootswatch themes are supported: https://bootswatch.com/)

On Thu, Nov 10, 2016 at 9:06 AM, digital-dharma notifications@github.com
wrote:

Background
The fantastic RNotebooks http://rmarkdown.rstudio.com/r_notebooks.html
functionality automatically creates a .html file from an RMarkdown
document. This HTML file can be shared with R programmers and non
R-programmers alike, and include both raw code as well as an general
narrative around the analysis being performed.

@yihui https://github.com/yihui 's site
http://statr.me/2016/08/creating-pretty-documents-with-the-prettydoc-package/
describes how RMarkdown can be augmented to produce documents with an
aesthetically pleasing theme.

Problem
It does not appear that RNotesbooks support this usage of themes.

Request
RNotebooks provide a tremendous methodology for dissemination of
analytics. Ensuring they support themes in the generation of HTML output
would be a fantastic addition.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#864, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGXx78ukLXvbEC3LsDTWUObYFZsDx7Tks5q8yTOgaJpZM4Kusk1
.

@yixuan
Copy link
Contributor

yixuan commented Nov 10, 2016

Yeah, prettydoc::html_pretty is a special version of rmarkdown::html_document to produce lightweight HTML. If you want to use html_notebook then you should look at the theme option provided by html_notebook as JJ suggested.

@jeff-mettel
Copy link
Author

Thanks @jjallaire @yixuan for the rapid response. I may be misunderstanding what is possible.

In your site, you provide the following YAML header:

---
title: Nineteen Years Later
author: Harry Potter
date: July 31, 2016
output:
  rmarkdown::html_document:
    theme: lumen
---

If I create a RNotebook with this header however, it seems to consider itself a Knitr document and the 'Preview Notebook' button disappears.

Essentially, what I am looking for is a way to ensure that the HTML generated automatically by RNotebooks respects whatever theme is provided in the header (And the bootswatch themes described on the site are great).

Is this possible?

@yixuan
Copy link
Contributor

yixuan commented Nov 10, 2016

Oh I see. Look at this line:

rmarkdown::html_document:

This is why the preview button disappears. You should change it to

---
title: Nineteen Years Later
author: Harry Potter
date: July 31, 2016
output:
  html_notebook:
    theme: lumen
---

But remember that the options of the theme parameter should take from

  • default
  • cerulean
  • journal
  • flatly
  • readable
  • spacelab
  • united
  • cosmo
  • lumen
  • paper
  • sandstone
  • simplex
  • yeti

Themes provided by the prettydoc package have not yet been supported.

@jeff-mettel
Copy link
Author

@yixuan - You nailed it, that was the problem. Thanks to everyone for all their help!

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants