knitrBootstrap

A framework to create bootstrap styled HTML reports from knitr Rmarkdown.

https://github.com/jimhester/knitrbootstrap

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 5 committers (20.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.8%) to scientific vocabulary

Keywords from Contributors

rmarkdown literate-programming pandoc bioconductor bioinformatics genomics
Last synced: 10 months ago · JSON representation

Repository

A framework to create bootstrap styled HTML reports from knitr Rmarkdown.

Basic Info
  • Host: GitHub
  • Owner: jimhester
  • License: other
  • Language: HTML
  • Default Branch: master
  • Homepage:
  • Size: 19.9 MB
Statistics
  • Stars: 277
  • Watchers: 27
  • Forks: 60
  • Open Issues: 25
  • Releases: 0
Created over 13 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog License

README.md

Knitr Bootstrap

A framework to create bootstrap styled HTML reports from knitr Rmarkdown.

Table of Contents

Features

  • Uses bootstrap 3.0, should work for all screen sizes.
  • Automatic table of contents constructed from h1-4 tags.
  • Images are automatically centered, thumbnailed and lightboxed using magnific popup.
  • Style with themes from bootswatch, optionally including a dynamic style switch.
  • Code blocks automatically highlighted using highlight.js, optionally including a dynamic style switch.
  • Code/Output block and plot visibility can be toggled with a mouse click
    • Globally
    • Per language
  • Create completely offline reports, including all css, javascript and images
  • Mathematical equations using mathjax, note this does not work offline

Examples

All the examples include a css style switch, so you can try out the various styles from bootswatch.

  • 2d - examples of miscellaneous 2d
  • cars - using ggplot2 and the cars dataset
  • engines - using other language engines
  • illusions - examples of interesting optical illusions
  • maps - examples of map plots, and holding plots until end of the block
  • math - examples of MathJax formulas
  • all - All examples together

Installation

If you want to install the latest development version use the devtools package to install the rmarkdown and knitr (devel) prerequisites and this package. s library(devtools) install_github('rstudio/rmarkdown') install.packages('knitr', repos = c('http://rforge.net', 'http://cran.rstudio.org'), type = 'source') install_github('jimhester/knitrBootstrap')

You can install the latest released version from CRAN. Typically lags behind latest by a good amount. s install.packages('knitrBootstrap')

Usage

Knitr Bootstrap includes a knitrBootstrap::bootstrap_document custom rendering function for use with the Rmarkdown package.

RStudio

Very current versions of RStudio use the render function when you press the "Knit" button. In order to output using knitrBootstrap use the YAML front-matter in your document.

YAML Front-matter

You can also specify the bootstrap_document function as an output type along with the options in the YAML front-matter directly in your Rmd file. All of the global Package Options can be specified in the front matter.

```s

output: knitrBootstrap::bootstrap_document: title: "Test file" theme: amelia highlight: sunburst theme.chooser: TRUE

highlight.chooser: TRUE

```

Render Function

You can also simply call the render function by itself. s library(knitrBootstrap) library(rmarkdown) render('file.Rmd', 'knitrBootstrap::bootstrap_document')

Vim

Using the Vim-R-Plugin put the following function in your .vimrc to create the file directly with knitr and the markdown package

```vim function! RMakeHTML2() update call RSetWD() let filename = expand("%:r:t") let rcmd = "require('knitrBootstrap');\ render(\"" . filename . ".Rmd\", knitrBootstrap::bootstrapdocument)" if g:vimrplugin_openhtml let rcmd = rcmd . '; browseURL("' . filename . '.html")' endif call g:SendCmdToR(rcmd) endfunction

"bind RMakeHTML2 to leader kk nnoremap kk :call RMakeHTML2() ```

Makefile

You can use the included Makefile to generate html reports from Rmd files from the command line. If you have a file file.Rmd and you want to create file.html use

```bash

standard

make file.html

with bootstrap style chooser

make THEME_CHOOSER=TRUE file.html

with code style chooser

make HIGHLIGHT_CHOOSER=TRUE file.html

with both

make HIGHLIGHTCHOOSER=TRUE THEMECHOOSER=TRUE file.html

standalone

make file_inline.html ```

Options

Knitr bootstrap extends knitr with a number of additional options. See Knitr Options for more about how to set the two different types of options.

Package Options

  • bootstrap.title - (NULL) Set the title for the html document
  • bootstrap.theme.chooser - (FALSE) - Add a bootstrap style chooser to the page.
  • bootstrap.highlight.chooser - (FALSE) - Add a code style chooser to the page.
  • bootstrap.theme - (Default) - Set the default bootstrap style.
  • bootstrap.highlight - (HighlightJS) - Set the default code style.
  • bootstrap.menu - (TRUE) - Whether to include the bottom navbar.
  • custom.header - (NULL) - External HTML header contents to include in header block.
  • clean_supporting - (TRUE) - Clean the intermediate supporting documents. (this is only an option for the bootstap_document function)

Chunk Options

  • bootstrap.thumbnail - (TRUE) - Thumbnail and lightbox images.
  • bootstrap.thumbnail.size - ('col-md-6') - Thumbnail size in bootstrap columns. (see Bootstrap Grid System)
  • bootstrap.panel - (FALSE) - Use panels rather than buttons to toggle blocks.
  • bootstrap.show.code - (TRUE) - Code from this chunk starts as shown.
  • bootstrap.show.output - (TRUE) - Output from this chunk starts as shown.
  • bootstrap.show.message - (TRUE) - message from this chunk starts as shown.
  • bootstrap.show.warning - (TRUE) - warning from this chunk starts as shown.
  • bootstrap.show.error - (TRUE) - error from this chunk starts as shown.
  • bootstrap.class - ('row') - Bootstrap class to apply to the div containing the chunk.

Bootstrap Themes

Highlight Themes

Highlight Live Test - HighlightJs - Dark - Far - Idea - Sunburst - Zenburn - Visual Studio - Ascetic - Magula - Github - Google Code - Brown Paper - School Book - IR Black - Solarized - Dark - Solarized - Light - Arta - Monokai - Xcode - Pojoaque - Rainbow - Tomorrow - Tomorrow Night - Tomorrow Night Bright - Tomorrow Night Blue - Tomorrow Night Eighties

Owner

  • Name: Jim Hester
  • Login: jimhester
  • Kind: user
  • Location: Cleveland, Ohio
  • Company: @netflix

Software Engineer @Netflix, previously @rstudio on @tidyverse team.

GitHub Events

Total
  • Watch event: 4
Last Year
  • Watch event: 4

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 225
  • Total Committers: 5
  • Avg Commits per committer: 45.0
  • Development Distribution Score (DDS): 0.036
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Jim Hester j****r@g****m 217
lcolladotor l****o@j****u 4
Keith Hughitt k****t@g****m 2
Yihui Xie x****e@y****e 1
Mikaunix m****x@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 81
  • Total pull requests: 20
  • Average time to close issues: 3 months
  • Average time to close pull requests: 3 days
  • Total issue authors: 42
  • Total pull request authors: 8
  • Average comments per issue: 2.83
  • Average comments per pull request: 3.25
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jimhester (14)
  • lcolladotor (13)
  • khughitt (6)
  • Black-Milk (3)
  • janeshdev (2)
  • kevinykuo (2)
  • maxbane (2)
  • znmeb (2)
  • paullemmens (2)
  • humburg (2)
  • frenkiboy (1)
  • WahiduzzamanKhan (1)
  • seracuso (1)
  • kohske (1)
  • janverbesselt (1)
Pull Request Authors
  • humburg (9)
  • khughitt (4)
  • lcolladotor (2)
  • pat-s (1)
  • jrowen (1)
  • jimhester (1)
  • srvanderplas (1)
  • mikaeldusenne (1)
Top Labels
Issue Labels
enhancement (5) wontfix (2) bug (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 970 last-month
  • Total docker downloads: 166,541
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 33
    (may contain duplicates)
  • Total versions: 11
  • Total maintainers: 1
cran.r-project.org: knitrBootstrap

'knitr' Bootstrap Framework

  • Versions: 9
  • Dependent Packages: 1
  • Dependent Repositories: 32
  • Downloads: 970 Last month
  • Docker Downloads: 166,541
Rankings
Forks count: 1.1%
Stargazers count: 1.5%
Dependent repos count: 4.7%
Average: 11.5%
Dependent packages count: 18.1%
Downloads: 19.0%
Docker downloads count: 24.8%
Maintainers (1)
Last synced: 12 months ago
conda-forge.org: r-knitrbootstrap
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Stargazers count: 23.1%
Forks count: 23.3%
Dependent repos count: 24.3%
Average: 30.6%
Dependent packages count: 51.6%
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.0.0 depends
  • knitr >= 1.5.25 imports
  • markdown * imports
  • rmarkdown * imports
  • corrplot * suggests
  • ggplot2 * suggests
  • igraph * suggests
  • mapproj * suggests
  • maps * suggests
  • maptools * suggests
  • plyr * suggests
  • reshape2 * suggests
  • roxygen2 * suggests
  • testthat * suggests
  • xtable * suggests