Open jimhester opened 9 years ago
Thanks!! Once that's done will it upgrade cleanly to Bootstrap 3.2.0?
If I want to test this, can I just do devtools::install_github('jimhester/knitrBootstrap', ref = 'rmarkdown_template')
?
Yes you can do either
# to install from the rmarkdown_template branch
devtools::install_github('jimhester/knitrBootstrap', ref = 'rmarkdown_template')
# or
devtools::install_github('jimhester/knitrBootstrap@rmarkdown_template')
# To install directly from this pull request
devtools::install_github('jimhester/knitrBootstrap#68')
Let me know if you have issues, or if you miss features I took out. I can add some back if they are things people liked.
The easiest way to get started is to use the rmarkdown templates in Rstudio.
OK - I'll be testing it tonight!! Do you have your own rmarkdown templates? I've been using the "Mosaic Fancy" template from https://github.com/rpruim/mosaic as a template and it works great once I figured out the MathJax code for in-line math.
I did a "new file" from the "knitrBootstrap" template in RStudio. That creates a directory with an Rmd file and a js and css folder. Doing a "knit" in RStudio gives an error -
Error in (function (css = NULL, theme = NULL, highlight = NULL, ...) :
could not find function "%||%"
Calls: <Anonymous> -> create_output_format -> do.call -> <Anonymous>
Execution halted
So does running "rmarkdown::render" in the console:
> getwd()
[1] "/data/Projects/journal-source/stories/knitrBootstrap"
> rmarkdown::render('knitrBootstrap.Rmd')
Error in (function (css = NULL, theme = NULL, highlight = NULL, ...) :
could not find function "%||%"
>
It looks like there aren't any vignettes now - at least only 'DESCRIPTION' and 'NEWS' are showing in the help panel. The install appears to have worked.
> devtools::install_github('jimhester/knitrBootstrap@rmarkdown_template')
Downloading github repo jimhester/knitrBootstrap@rmarkdown_template
Installing knitrBootstrap
'/usr/lib64/R/bin/R' --vanilla CMD INSTALL \
'/tmp/RtmpG1nI5K/devtools28ca7e37c723/jimhester-knitrBootstrap-25924a2' \
--library='/usr/lib64/R/library' --install-tests
* installing *source* package ‘knitrBootstrap’ ...
** R
** exec
** inst
** preparing package for lazy loading
** help
No man pages found in package ‘knitrBootstrap’
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (knitrBootstrap)
Making 'packages.html' ... done
>
Here's what's in the library after the install:
/usr/lib64/R/library/knitrBootstrap:
total 48
-rw-r--r--. 1 root root 984 Oct 8 20:45 DESCRIPTION
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 examples
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 exec
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 help
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 html
-rw-r--r--. 1 root root 40 Oct 8 20:45 LICENSE
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 Meta
-rw-r--r--. 1 root root 159 Oct 8 20:45 NAMESPACE
-rw-r--r--. 1 root root 2202 Oct 8 20:45 NEWS
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 R
drwxr-xr-x. 4 root root 4096 Oct 8 20:45 rmarkdown
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 templates
/usr/lib64/R/library/knitrBootstrap/examples:
total 3448
-rw-r--r--. 1 root root 3067595 Oct 8 20:45 all.html
-rw-r--r--. 1 root root 489 Oct 8 20:45 all.Rmd
-rw-r--r--. 1 root root 440344 Oct 8 20:45 engines.html
-rw-r--r--. 1 root root 3590 Oct 8 20:45 engines.Rmd
-rw-r--r--. 1 root root 6394 Oct 8 20:45 messages.html
-rw-r--r--. 1 root root 630 Oct 8 20:45 messages.Rmd
/usr/lib64/R/library/knitrBootstrap/exec:
total 4
-rwxr-xr-x. 1 root root 3010 Oct 8 20:45 encode.pl
/usr/lib64/R/library/knitrBootstrap/help:
total 12
-rw-r--r--. 1 root root 60 Oct 8 20:45 aliases.rds
-rw-r--r--. 1 root root 0 Oct 8 20:45 AnIndex
-rw-r--r--. 1 root root 0 Oct 8 20:45 knitrBootstrap.rdb
-rw-r--r--. 1 root root 113 Oct 8 20:45 knitrBootstrap.rdx
-rw-r--r--. 1 root root 64 Oct 8 20:45 paths.rds
/usr/lib64/R/library/knitrBootstrap/html:
total 8
-rw-r--r--. 1 root root 920 Oct 8 20:45 00Index.html
-rw-r--r--. 1 root root 1179 Oct 8 20:45 R.css
/usr/lib64/R/library/knitrBootstrap/Meta:
total 20
-rw-r--r--. 1 root root 190 Oct 8 20:45 hsearch.rds
-rw-r--r--. 1 root root 38 Oct 8 20:45 links.rds
-rw-r--r--. 1 root root 228 Oct 8 20:45 nsInfo.rds
-rw-r--r--. 1 root root 1020 Oct 8 20:45 package.rds
-rw-r--r--. 1 root root 164 Oct 8 20:45 Rd.rds
/usr/lib64/R/library/knitrBootstrap/R:
total 16
-rw-r--r--. 1 root root 1056 Oct 8 20:45 knitrBootstrap
-rw-r--r--. 1 root root 7354 Oct 8 20:45 knitrBootstrap.rdb
-rw-r--r--. 1 root root 523 Oct 8 20:45 knitrBootstrap.rdx
/usr/lib64/R/library/knitrBootstrap/rmarkdown:
total 8
drwxr-xr-x. 5 root root 4096 Oct 8 20:45 rmd
drwxr-xr-x. 4 root root 4096 Oct 8 20:45 templates
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd:
total 16
drwxr-xr-x. 5 root root 4096 Oct 8 20:45 bootstrap3
-rw-r--r--. 1 root root 2690 Oct 8 20:45 default.html
drwxr-xr-x. 3 root root 4096 Oct 8 20:45 highlightjs
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 magnific_popup
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3:
total 12
drwxr-xr-x. 3 root root 4096 Oct 8 20:45 css
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 fonts
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 js
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css:
total 112
-rw-r--r--. 1 root root 109518 Oct 8 20:45 bootstrap.min.css
drwxr-xr-x. 19 root root 4096 Oct 8 20:45 themes
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes:
total 68
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 amelia
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 cerulean
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 cosmo
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 cyborg
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 darkly
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 flatly
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 journal
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 lumen
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 paper
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 readable
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 sandstone
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 simplex
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 slate
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 spacelab
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 superhero
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 united
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 yeti
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/amelia:
total 112
-rw-r--r--. 1 root root 111576 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/cerulean:
total 112
-rw-r--r--. 1 root root 114267 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/cosmo:
total 112
-rw-r--r--. 1 root root 111733 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/cyborg:
total 112
-rw-r--r--. 1 root root 111555 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/darkly:
total 112
-rw-r--r--. 1 root root 113576 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/flatly:
total 112
-rw-r--r--. 1 root root 113285 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/journal:
total 112
-rw-r--r--. 1 root root 111171 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/lumen:
total 116
-rw-r--r--. 1 root root 116301 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/paper:
total 116
-rw-r--r--. 1 root root 116578 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/readable:
total 112
-rw-r--r--. 1 root root 112177 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/sandstone:
total 112
-rw-r--r--. 1 root root 112036 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/simplex:
total 112
-rw-r--r--. 1 root root 113254 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/slate:
total 124
-rw-r--r--. 1 root root 123889 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/spacelab:
total 116
-rw-r--r--. 1 root root 116538 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/superhero:
total 112
-rw-r--r--. 1 root root 112381 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/united:
total 108
-rw-r--r--. 1 root root 110052 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/css/themes/yeti:
total 116
-rw-r--r--. 1 root root 114962 Oct 8 20:45 bootstrap.min.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/fonts:
total 152
-rw-r--r--. 1 root root 20335 Oct 8 20:45 glyphicons-halflings-regular.eot
-rw-r--r--. 1 root root 62927 Oct 8 20:45 glyphicons-halflings-regular.svg
-rw-r--r--. 1 root root 41280 Oct 8 20:45 glyphicons-halflings-regular.ttf
-rw-r--r--. 1 root root 23320 Oct 8 20:45 glyphicons-halflings-regular.woff
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/bootstrap3/js:
total 32
-rw-r--r--. 1 root root 31819 Oct 8 20:45 bootstrap.min.js
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/highlightjs:
total 44
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 highlight
-rw-r--r--. 1 root root 37977 Oct 8 20:45 highlight.pack.js
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/highlightjs/highlight:
total 196
-rw-r--r--. 1 root root 2235 Oct 8 20:45 arta.css
-rw-r--r--. 1 root root 830 Oct 8 20:45 ascetic.css
-rw-r--r--. 1 root root 1738 Oct 8 20:45 atelier-dune.dark.css
-rw-r--r--. 1 root root 1752 Oct 8 20:45 atelier-dune.light.css
-rw-r--r--. 1 root root 1763 Oct 8 20:45 atelier-forest.dark.css
-rw-r--r--. 1 root root 1772 Oct 8 20:45 atelier-forest.light.css
-rw-r--r--. 1 root root 1753 Oct 8 20:45 atelier-heath.dark.css
-rw-r--r--. 1 root root 1762 Oct 8 20:45 atelier-heath.light.css
-rw-r--r--. 1 root root 1784 Oct 8 20:45 atelier-lakeside.dark.css
-rw-r--r--. 1 root root 1793 Oct 8 20:45 atelier-lakeside.light.css
-rw-r--r--. 1 root root 1774 Oct 8 20:45 atelier-seaside.dark.css
-rw-r--r--. 1 root root 1783 Oct 8 20:45 atelier-seaside.light.css
-rw-r--r--. 1 root root 1769 Oct 8 20:45 brown_paper.css
-rw-r--r--. 1 root root 1520 Oct 8 20:45 codepen-embed.css
-rw-r--r--. 1 root root 2809 Oct 8 20:45 color-brewer.css
-rw-r--r--. 1 root root 1740 Oct 8 20:45 dark.css
-rw-r--r--. 1 root root 2602 Oct 8 20:45 default.css
-rw-r--r--. 1 root root 1814 Oct 8 20:45 docco.css
-rw-r--r--. 1 root root 1849 Oct 8 20:45 far.css
-rw-r--r--. 1 root root 1604 Oct 8 20:45 foundation.css
-rw-r--r--. 1 root root 1723 Oct 8 20:45 github.css
-rw-r--r--. 1 root root 2138 Oct 8 20:45 googlecode.css
-rw-r--r--. 1 root root 2674 Oct 8 20:45 hybrid.css
-rw-r--r--. 1 root root 1775 Oct 8 20:45 idea.css
-rw-r--r--. 1 root root 1486 Oct 8 20:45 ir_black.css
-rw-r--r--. 1 root root 1547 Oct 8 20:45 kimbie.dark.css
-rw-r--r--. 1 root root 1547 Oct 8 20:45 kimbie.light.css
-rw-r--r--. 1 root root 1878 Oct 8 20:45 magula.css
-rw-r--r--. 1 root root 923 Oct 8 20:45 mono-blue.css
-rw-r--r--. 1 root root 1992 Oct 8 20:45 monokai.css
-rw-r--r--. 1 root root 2334 Oct 8 20:45 monokai_sublime.css
-rw-r--r--. 1 root root 2256 Oct 8 20:45 obsidian.css
-rw-r--r--. 1 root root 1513 Oct 8 20:45 paraiso.dark.css
-rw-r--r--. 1 root root 1514 Oct 8 20:45 paraiso.light.css
-rw-r--r--. 1 root root 1663 Oct 8 20:45 pojoaque.css
-rw-r--r--. 1 root root 2574 Oct 8 20:45 railscasts.css
-rw-r--r--. 1 root root 1619 Oct 8 20:45 rainbow.css
-rw-r--r--. 1 root root 1961 Oct 8 20:45 school_book.css
-rw-r--r--. 1 root root 1622 Oct 8 20:45 solarized_dark.css
-rw-r--r--. 1 root root 1622 Oct 8 20:45 solarized_light.css
-rw-r--r--. 1 root root 2262 Oct 8 20:45 sunburst.css
-rw-r--r--. 1 root root 1449 Oct 8 20:45 tomorrow.css
-rw-r--r--. 1 root root 1623 Oct 8 20:45 tomorrow-night-blue.css
-rw-r--r--. 1 root root 1553 Oct 8 20:45 tomorrow-night-bright.css
-rw-r--r--. 1 root root 1620 Oct 8 20:45 tomorrow-night.css
-rw-r--r--. 1 root root 1557 Oct 8 20:45 tomorrow-night-eighties.css
-rw-r--r--. 1 root root 1534 Oct 8 20:45 vs.css
-rw-r--r--. 1 root root 2270 Oct 8 20:45 xcode.css
-rw-r--r--. 1 root root 1854 Oct 8 20:45 zenburn.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/rmd/magnific_popup:
total 24
-rw-r--r--. 1 root root 7782 Oct 8 20:45 magnific-popup.css
-rw-r--r--. 1 root root 14630 Oct 8 20:45 magnific-popup.js
/usr/lib64/R/library/knitrBootstrap/rmarkdown/templates:
total 8
drwxr-xr-x. 3 root root 4096 Oct 8 20:45 knitrBootstrap
drwxr-xr-x. 3 root root 4096 Oct 8 20:45 simple
/usr/lib64/R/library/knitrBootstrap/rmarkdown/templates/knitrBootstrap:
total 8
drwxr-xr-x. 4 root root 4096 Oct 8 20:45 skeleton
-rw-r--r--. 1 root root 59 Oct 8 20:45 template.yaml
/usr/lib64/R/library/knitrBootstrap/rmarkdown/templates/knitrBootstrap/skeleton:
total 12
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 css
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 js
-rw-r--r--. 1 root root 124 Oct 8 20:45 skeleton.Rmd
/usr/lib64/R/library/knitrBootstrap/rmarkdown/templates/knitrBootstrap/skeleton/css:
total 12
-rw-r--r--. 1 root root 11706 Oct 8 20:45 knitrBootstrap.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/templates/knitrBootstrap/skeleton/js:
total 4
-rw-r--r--. 1 root root 1252 Oct 8 20:45 knitrBootstrap.js
/usr/lib64/R/library/knitrBootstrap/rmarkdown/templates/simple:
total 8
drwxr-xr-x. 4 root root 4096 Oct 8 20:45 skeleton
-rw-r--r--. 1 root root 74 Oct 8 20:45 template.yaml
/usr/lib64/R/library/knitrBootstrap/rmarkdown/templates/simple/skeleton:
total 12
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 css
drwxr-xr-x. 2 root root 4096 Oct 8 20:45 js
-rw-r--r--. 1 root root 107 Oct 8 20:45 skeleton.Rmd
/usr/lib64/R/library/knitrBootstrap/rmarkdown/templates/simple/skeleton/css:
total 8
-rw-r--r--. 1 root root 5017 Oct 8 20:45 simple.css
/usr/lib64/R/library/knitrBootstrap/rmarkdown/templates/simple/skeleton/js:
total 4
-rw-r--r--. 1 root root 894 Oct 8 20:45 simple.js
/usr/lib64/R/library/knitrBootstrap/templates:
total 44
-rw-r--r--. 1 root root 2742 Oct 8 20:45 default.html
-rw-r--r--. 1 root root 7297 Oct 8 20:45 knitr_bootstrap_code_style_toggle.html
-rw-r--r--. 1 root root 11730 Oct 8 20:45 knitr_bootstrap.css
-rw-r--r--. 1 root root 1947 Oct 8 20:45 knitr_bootstrap_includes.html
-rw-r--r--. 1 root root 5391 Oct 8 20:45 knitr_bootstrap.js
-rw-r--r--. 1 root root 4110 Oct 8 20:45 knitr_bootstrap_style_toggle.html
Sorry you ran into difficulties, I split a few functions into their own file but neglected to add it to the repository. If you reinstall the latest version from the branch it should now work.
Yep - working now! Notes:
I don't know if I've posted this before, but the target for all of this activity is my new blog, znmeb.bitbucket.org. That's built with Nikola and I can either post HTML out of knitrBootstrap or raw Markdown there. Actually I can post anything Pandoc can handle; Nikola has the option to call out to Pandoc as a compiler. Nikola's "native" language is Restructured Text, which is big amongst the Pythonistas.
@znmeb Mathjax should be working now. As far as the toggles go there is no way to get rid of them completely. You may want to try using simple_document
which uses only a small toggle on the side of each block instead of the buttons or panels used in bootstrap_document
.
I could also make a version which does not have a toggle at all and only has a thin panel outline based on the code type if that is what you are looking for.
I'm going for "mobile first" here - the toggles (and the old navbar and theme magic) work on a mobile small screen but they distract from the content. If you've got a recent version of Firefox handy, go into the 'Developer' menu, select 'Responsive Design View' and look at a rendered page with resolution 320x480. Bootstrap 3 itself works that way, although I've had some issues with a few of the themes. I ended up with 'Cosmo' on http://znmeb.bitbucket.org/stories/mosaic-fancy-test-document.html because of the theme issues.
Incidentally, the workflow for that test page used RStudio knit
.Rmd
-> Pandoc Markdown followed by Nikola
Pandoc compilation of the Markdown to HTML. Migrating to knitrBootstrap will replace all the rendering in Nikola with HTML made in RStudio.
Hi,
I just noticed all of these changes. Is there somewhere I should look for some minor docs? Or should I wait a bit longer before testing?
I am hoping that it won't be too hard to switch to this version from the previous github one as I'm using knitrBootstrap
for my recently accepted packages in Bioconductor.
knitrBootstrap
's CRAN version) vignettes: basic and advanced versus GitHub hosted versions basic and advanced I'm using a makefile for creating the vignettes and specifying the appropriate call depending on the knitrBoostrap
version as seen here.
Thank you again for making knitrBootstrap
!
I've updated my workflow for http://znmeb.bitbucket.org; see http://znmeb.bitbucket.org/stories/blogging-with-rstudio-and-nikola.html for the details. I'm generating un-themed HTML using the standard RStudio knitr-pandoc chain. I then pass the un-themed HTML to Nikola for theming and the rest of the site building. I'll be migrating to knitrBootstrap once the next release is out and turning off most of the Nikola theming for RStudio-authored documents.
@lcolladotor Please try out the new version, I would like as much user input as possible before switching. If you miss something let me know and I can add it. I am also thinking of making the simple format the default one, so I feedback on how everyone likes that would be great.
In terms of creating vignettes with the new version it should be easier than previously, you can just use the following YAML header. I will make a template with this header in it, so it will be very easy to do in the future.
---
title: "Vignette Title"
author: "Vignette Author"
date: "`r Sys.Date()`"
output:
knitrBootstrap::simple_document
toc: true
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---
Hi,
Both bootstrap_document
and simple_document
work for me as shown using:
Note that in boostrap_document the YAML for author and date is not used, while it is used in simple_document. Probably this is as intended but it would be great if both formats had the same set of YAML options. The YAML for title gets used for the tab title on both, but it's only displayed inside the document for simple_document.
Also, in simple_document the chunk options bootstrap.show.code
, bootstrap.show.warning
, bootstrap.show.message
don't work. I think that this is not intended. If it is, well, I think that a great part of what you can do with knitrBootstrap
comes with using those options. That is, you want to have everything in one document and tailor it for one type of audience (say those interested in the results) while those interested in the details have everything available at hand.
Menu works. I haven't tested a long TOC though.
Integration with DataTables works. In my tests I am using the way where you rely on knitr::kable()
. The other option of using rCharts
should work too. While I like the rCharts
way better (if you have a big table you don't have to send lots of data), the knitr::kable()
way is available on CRAN and that's something I need for Bioconductor.
My main concern with version a7615dc is that you create a set of supporting files which you need to distribute along the HTML. Otherwise the HTML doesn't render well. This can be a problem because the supporting directory is 2.5 mb (the subdir bootstrap3-3.2.0 is 2.3 mb) is that you would need to include them on the output for R CMD build
for others to view the vignettes correctly (users who don't recompile vignettes). Plus, even if you have two Rmd files on the same directory, you get two copies of the supporting files. So on my derfinder
package where I have 2 vignettes, that would mean 5 mb of supporting files. Or maybe there's an option I'm missing that controls this and forces you to have an active internet connection to render the HTML correctly.
Overall, this version is great!! And yes, like you said, it's very easy to specify the YAML header.
Great work! Leo
Regarding simple_document vs bootstrap_document, I like boostrap_document more because the toggles are informative. For simple_document, toggles are also informative if you know what the colors mean (like us), but not everyone knows them.
As for the supporting files in bootstrap3-3.2.0, I see that it gets large due to bootstrap3-3.2.0/css/themes
where you include the css for lots of themes. Given that there no longer is a menu to change the theme, you can likely reduce a lot of space by getting rid of the unused ones..
Hm... I see in rmarkdown::html_document()
a self_contained
option which I see described at the HTML docs page. However using:
---
title: "Test knitrBootstrap a7615dc"
author: "L Collado-Torres"
date: "`r Sys.Date()`"
output:
knitrBootstrap::bootstrap_document:
toc: true
fig_caption: true
self_contained: false
---
and then with the knit
button in Rstudio I get the following error:
Error in rmarkdown::html_document(highlight = NULL, theme = NULL, extra_dependencies = list(rmarkdown:::html_dependency_jquery(), :
formal argument "self_contained" matched by multiple actual arguments
Calls: <Anonymous> ... create_output_format -> do.call -> <Anonymous> -> <Anonymous>
Execution halted
Same with using:
> library('rmarkdown')
> library('knitrBootstrap')
> system.time(render('bootdoc_self.Rmd', 'knitrBootstrap::bootstrap_document'))
Error in rmarkdown::html_document(highlight = NULL, theme = NULL, extra_dependencies = list(rmarkdown:::html_dependency_jquery(), :
formal argument "self_contained" matched by multiple actual arguments
Timing stopped at: 0.018 0.009 0.029
> traceback()
6: rmarkdown::html_document(highlight = NULL, theme = NULL, extra_dependencies = list(rmarkdown:::html_dependency_jquery(),
html_dependency_bootstrap3(theme), html_dependency_hljs(highlight),
html_dependency_magnific_popup(), html_dependency_knitrBootstrap()),
template = system.file(package = "knitrBootstrap", "rmarkdown/rmd/default.html"),
pandoc_args = c("--no-wrap", "--variable", "mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"),
self_contained = FALSE, ...)
5: (function (css = NULL, theme = NULL, highlight = NULL, ...)
{
theme = theme %||% "default"
highlight = highlight %||% "default"
results = rmarkdown::html_document(highlight = NULL, theme = NULL,
extra_dependencies = list(rmarkdown:::html_dependency_jquery(),
html_dependency_bootstrap3(theme), html_dependency_hljs(highlight),
html_dependency_magnific_popup(), html_dependency_knitrBootstrap()),
template = system.file(package = "knitrBootstrap", "rmarkdown/rmd/default.html"),
pandoc_args = c("--no-wrap", "--variable", "mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"),
self_contained = FALSE, ...)
results$knitr = list(opts_chunk = list(tidy = FALSE, highlight = FALSE),
knit_hooks = render_bootstrap_hooks())
results
})(toc = TRUE, fig_caption = TRUE, self_contained = FALSE)
4: do.call(output_format_func, options)
3: create_output_format(output_format$name, output_format$options)
2: render("bootdoc_self.Rmd", "knitrBootstrap::bootstrap_document")
1: system.time(render("bootdoc_self.Rmd", "knitrBootstrap::bootstrap_document"))
I see that you have by default self_contained = FALSE
but there is that multiple usage problem. Hm...
I'm running into a couple problems with this update. First, self_contained: yes
doesn't to work. As noted above, it generates a formal argument "self_contained" matched by multiple actual arguments
error. Second, I'm running into some missing resource errors. The javascript console output is below.
Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///Y:/highlightjs-8.2/highlight.pack.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700 Failed to load resource: net::ERR_FILE_NOT_FOUND
knitrBootstrap.js:22 Uncaught ReferenceError: hljs is not defined
file:///Y:/bootstrap3-3.2.0/css/themes/fonts/glyphicons-halflings-regular.woff Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///Y:/bootstrap3-3.2.0/css/themes/fonts/glyphicons-halflings-regular.ttf Failed to load resource: net::ERR_FILE_NOT_FOUND
and markdown options I'm using are
knitrBootstrap::bootstrap_document:
include:
before_body:
- ../templates/before_body.html
in_header:
- ../templates/header.html
keep_md: yes
theme: spacelab
highlight: highlightjs
toc: yes
The in_header
and before_body
options appear to be working fine.
Hi, I was just curious about how this is going. I found this again due to the bug reported in https://github.com/jimhester/knitrBootstrap/issues/53
Anyhow, I'm sure that you are quite busy with Bioconductor.
It isn't really making any progress unfortunately :frowning:. I haven't really done any analysis for almost two years at this point so my major impetus for writing knitrBootstrap (documenting analysis pipelines) is absent.
I would really like this branch to be merged, as it is a simpler approach than previously and will inherit all of the testing and bug fixes from the close relationship with rmarkdown
.
However there are a couple of things holding it back,
FALSE
currently.knitrBootstrap
behavior was to have all HTML dependencies as links. Ideally both options would be supported. htmltools::html_depenency() does support supplying multiple dependency locations for a given dependency (i.e. local and remote), so that would be the way forward. I don't really know what the proper way to allow the user to choose which dependency to use is however.rmarkdown
, but there is probably a way to specify a conditional dependency?rmarkdown
has largely fixed most of the motivating purpose behind knitrBootstrap
. Namely there now exists an easy way to get decently styled reports from a knitr markdown document. I am unsure how much marginal benefit knitrBootstrap
gives over the standard rmarkdown
themes.I unfortunately don't have much time or motivation to tackle the above issues (which is most of the reason progress has stagnated). @lcolladotor if you want to try and tackle any of the above I would be more than happy to review the code.
While this may seem like a depressing reply I think this branch is actually very close to completion and would be an improvement in the project, so if you have any interest I would encourage you or anyone else to give it a try!
Yes, your reply was depressing at first. I even mentioned it today in our group meeting. To me, the best feature in knitrBootstrap
is the ability to toggle code/output/messages/etc. So I looked a bit around for other alternatives and couldn't really find one. So, I gave it a go and looked at the code of this branch for the first time. I don't really know css/js, but I can understand most of what you have and it looks very simple. The tools around the rmarkdown
ecosystem really have made developing templates much easier.
So, like you said, it does feel like this branch is a few commits away from being completed and pushed to CRAN (hey, hope doesn't die easily :P). Regarding your bullet points.
text-content
span for the buttons, then change the css. This might take me some time as I google css stuff.rmarkdown
's changes. However, toggling is a big thing like I have said earlier. It really allows you to create a single document for 2 audiences which is the only document I have seen that is able to achieve this so far. I also like the TOC, thumbsized images and the overall look of the doc (I understand that others might prefer the look of other templates).One quick question:
Hopefully I'll have a PR soon for you to play around a bit.
Re: generate_code_block()
, that was an error on my part, 4b0708e should fix it.
Thank you for taking up the gauntlet and let me know if there is anyplace you get stuck, I can try to help.
Just an FYI to anyone watching this thread the newest version of Rmarkdown has support for code folding (http://blog.rstudio.org/2016/03/21/rmarkdown-v0-9-5/) which was one of the few remaining features knitrBootstrap had that regular rmarkdown did not.
Thanks for the note @jimhester. It looks very promising.
I'm guessing that you were involved in this now that you are at RStudio.
Cheers, Leo
I had a lot of unread notifications from knitrBootstrap
and until I went through them did I realize that @humburg has been doing a lot of great work on this package. I did switch my regionReport
to use rmarkdown
v0.9.5 by default as documented at https://github.com/leekgroup/regionReport/commit/e9d8aebceb35b14387903c69a572b975acafc05a. One feature from knitrBootstrap
that I think is missing in rmarkdown
is the thumbnails for the figures.
Anyhow, I don't know if you plan on pushing this branch to CRAN
or not and it's probably too early to tell. For now, I'll leave the option to use knitrBootstrap
on regionReport
.
This is a major restructuring of the package embracing
rmarkdown
fully. It has two main features,html_document()
It aims to do as little work in javascript as possible, namely no DOM restructuring (other than highlighting).