| ^bulmaRmd\.Rproj$ | |||||
| ^\.Rproj\.user$ |
| download.file("https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.min.css", "inst/bulma/bulma.0.7.2.min.css") | |||||
| rmarkdown:::pandoc_options(args = "--template something") | |||||
| download.file("https://raw.githubusercontent.com/ijlyttle/user2016_knitr/master/Part1/1_PandocMarkdown/pandoc-markdown.bib", "tests/manual/bibfile.bib") | |||||
| use_r("bulma_document") | |||||
| rmarkdown::html_document | |||||
| rmarkdown:::rmarkdown_system_file | |||||
| use_package("rmarkdown") | |||||
| library(bulmaRmd) | |||||
| library(bulmaRmd) | |||||
| library(bulmaRmd) | |||||
| library(bulmaRmd) | |||||
| library(bulmaRmd) | |||||
| system.file("inst", "bulma", "bulma.html", package="bulmaRmd") | |||||
| library(bulmaRmd) | |||||
| system.file("inst", "bulma", "bulma.html", package="bulmaRmd") | |||||
| system.file("bulma", package="bulmaRmd") | |||||
| system.file("bulma", "bulma.html", package="bulmaRmd") | |||||
| library(bulmaRmd) | |||||
| library(bulmaRmd) | |||||
| library(bulmaRmd) | |||||
| c("--css", c("a", "b")) | |||||
| library(bulmaRmd) | |||||
| library(bulmaRmd) | |||||
| library(bulmaRmd) | |||||
| usethis:::restart_rstudio() |
| .Rproj.user |
| Package: bulmaRmd | |||||
| Title: What the Package Does (One Line, Title Case) | |||||
| Version: 0.0.0.9000 | |||||
| Authors@R: | |||||
| person(given = "Garrick", | |||||
| family = "Aden-Buie", | |||||
| role = c("aut", "cre"), | |||||
| email = "g.adenbuie@gmail.com") | |||||
| Description: What the package does (one paragraph). | |||||
| License: MIT + file LICENSE | |||||
| Encoding: UTF-8 | |||||
| LazyData: true | |||||
| Imports: | |||||
| rmarkdown | |||||
| RoxygenNote: 6.1.1 |
| # Generated by roxygen2: do not edit by hand | |||||
| export(bulma_document) |
| #' Bulma Document Renderer | |||||
| #' | |||||
| #' @inheritDotParams rmarkdown::html_document_base | |||||
| #' @export | |||||
| bulma_document <- function(..., css = NULL, pandoc_args = NULL) { | |||||
| css_files <- c( | |||||
| "--css", system.file("bulma", "bulma.0.7.2.min.css", package="bulmaRmd")) | |||||
| if (!is.null(css)) { | |||||
| for (file in css) { | |||||
| css_files <- c(css_files, "--css", file) | |||||
| } | |||||
| } | |||||
| rmarkdown::html_document_base( | |||||
| pandoc_args = c( | |||||
| css_files, | |||||
| pandoc_args, | |||||
| "--template", | |||||
| system.file("bulma", "bulma.html", package="bulmaRmd") | |||||
| ), | |||||
| ... | |||||
| ) | |||||
| } |
| Version: 1.0 | |||||
| RestoreWorkspace: No | |||||
| SaveWorkspace: No | |||||
| AlwaysSaveHistory: Default | |||||
| EnableCodeIndexing: Yes | |||||
| UseSpacesForTab: Yes | |||||
| NumSpacesForTab: 2 | |||||
| Encoding: UTF-8 | |||||
| RnwWeave: Sweave | |||||
| LaTeX: pdfLaTeX | |||||
| AutoAppendNewline: Yes | |||||
| StripTrailingWhitespace: Yes | |||||
| BuildType: Package | |||||
| PackageUseDevtools: Yes | |||||
| PackageInstallArgs: --no-multiarch --with-keep.source | |||||
| PackageRoxygenize: rd,collate,namespace |
| <!DOCTYPE html> | |||||
| <html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$> | |||||
| <head> | |||||
| <meta charset="utf-8" /> | |||||
| <meta name="generator" content="pandoc" /> | |||||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> | |||||
| $for(author-meta)$ | |||||
| <meta name="author" content="$author-meta$" /> | |||||
| $endfor$ | |||||
| $if(date-meta)$ | |||||
| <meta name="dcterms.date" content="$date-meta$" /> | |||||
| $endif$ | |||||
| $if(keywords)$ | |||||
| <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" /> | |||||
| $endif$ | |||||
| <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title> | |||||
| <style type="text/css"> | |||||
| code{white-space: pre-wrap;} | |||||
| span.smallcaps{font-variant: small-caps;} | |||||
| span.underline{text-decoration: underline;} | |||||
| div.column{display: inline-block; vertical-align: top; width: 50%;} | |||||
| $if(quotes)$ | |||||
| q { quotes: "“" "”" "‘" "’"; } | |||||
| $endif$ | |||||
| </style> | |||||
| $if(highlighting-css)$ | |||||
| <style type="text/css"> | |||||
| $highlighting-css$ | |||||
| </style> | |||||
| $endif$ | |||||
| <style type="text/css" charset="utf-8"> | |||||
| body { | |||||
| font-family: "Fira Sans", "Helvetica Neue", Roboto, sans-serif; | |||||
| } | |||||
| pre, code { | |||||
| font-family: "Fira Mono", "Roboto Mono", monospace; | |||||
| } | |||||
| .content table { | |||||
| width: auto; | |||||
| margin: auto; | |||||
| } | |||||
| .tabs-content li { | |||||
| display: none; | |||||
| list-style: none; | |||||
| } | |||||
| .tabs-content li.is-active { | |||||
| display: block; | |||||
| } | |||||
| </style> | |||||
| $for(css)$ | |||||
| <link rel="stylesheet" href="$css$" /> | |||||
| $endfor$ | |||||
| <script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script> | |||||
| $for(header-includes)$ | |||||
| $header-includes$ | |||||
| $endfor$ | |||||
| </head> | |||||
| <body> | |||||
| <section class="hero$if(bulma.hero)$$for(bulma.hero)$ is-$bulma.hero$$endfor$$else$ is-primary$endif$"> | |||||
| <div class="hero-body"> | |||||
| <div class="container"> | |||||
| $if(title)$ | |||||
| <h1 class="title is-1 toc-ignore">$title$</h1> | |||||
| $endif$ | |||||
| $if(subtitle)$ | |||||
| <h1 class="subtitle is-3 toc-ignore"><em>$subtitle$</em></h1> | |||||
| $endif$ | |||||
| $if(header-links)$ | |||||
| $for(header-links)$ | |||||
| <a class="button is-primary is-inverted is-outlined" href="$header-links.url$">$header-links.name$</a> | |||||
| $endfor$ | |||||
| $endif$ <!-- header-links --> | |||||
| </div> | |||||
| </div> | |||||
| </section> | |||||
| <section class="section"> | |||||
| <div class="container"> | |||||
| <div class="content" id="content-body"> | |||||
| $if(author)$ | |||||
| <div class="level"> | |||||
| $for(author)$ | |||||
| <div class="level-item has-text-centered"> | |||||
| <div> | |||||
| $if(author.name)$ | |||||
| <p class="title is-5"> | |||||
| $if(author.url)$ | |||||
| <a href="$author.url$">$author.name$</a> | |||||
| $else$ | |||||
| $author.name$ | |||||
| $endif$ | |||||
| </p> | |||||
| $endif$ | |||||
| $if(author.extra)$ | |||||
| <p class="subtitle is-6"> | |||||
| $for(author.extra)$$author.extra$$sep$<br>$endfor$ | |||||
| </p> | |||||
| $endif$ | |||||
| </div> | |||||
| </div> | |||||
| $endfor$ | |||||
| </div> | |||||
| $endif$ | |||||
| $body$ | |||||
| </div> | |||||
| </div> | |||||
| </section> | |||||
| $for(include-after)$ | |||||
| $include-after$ | |||||
| $endfor$ | |||||
| <script> | |||||
| // add bulma table styles to pandoc tables | |||||
| document.addEventListener("DOMContentLoaded", function(event) { | |||||
| var tableClasses = ["table", "is-striped", "is-hoverable"]; | |||||
| var tables = document.getElementById('content-body').getElementsByTagName("table"); | |||||
| for (var i = 0; i < tables.length; i++) { | |||||
| tables[i].classList.add(...tableClasses); | |||||
| } | |||||
| }) | |||||
| </script> | |||||
| $if(mathjax-url)$ | |||||
| <!-- dynamically load mathjax for compatibility with self-contained --> | |||||
| <script> | |||||
| (function () { | |||||
| var script = document.createElement("script"); | |||||
| script.type = "text/javascript"; | |||||
| script.src = "$mathjax-url$"; | |||||
| document.getElementsByTagName("head")[0].appendChild(script); | |||||
| })(); | |||||
| </script> | |||||
| $endif$ | |||||
| </body> | |||||
| </html> |
| --- | |||||
| title: "Title" | |||||
| subtitle: "A minimal Bulma RMarkdown Template" | |||||
| author: | |||||
| - name: First Author | |||||
| url: https://rstudio.com | |||||
| extra: | |||||
| - "First Affiliation" | |||||
| - "@tweeter345" | |||||
| - name: Second Author | |||||
| url: https://duckduckgo.com | |||||
| extra: | |||||
| - "Second Affiliation" | |||||
| - "Very Cool Guy" | |||||
| date: '`r strftime(Sys.time(), "%F %T")`' | |||||
| header-links: | |||||
| - name: Github | |||||
| url: https://github.com/gerkelab | |||||
| - name: Home | |||||
| url: https://gerkelab.com | |||||
| bulma: | |||||
| hero: ["info", "bold"] | |||||
| output: bulmaRmd::bulma_document | |||||
| --- | |||||
| ```{r setup, include=FALSE} | |||||
| knitr::opts_chunk$set(echo = TRUE) | |||||
| ``` | |||||
| ## R Markdown | |||||
| This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. | |||||
| When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: | |||||
| ```{r cars} | |||||
| summary(cars) | |||||
| ``` | |||||
| ## Including Plots | |||||
| You can also embed plots, for example: | |||||
| ```{r pressure, echo=FALSE} | |||||
| plot(pressure) | |||||
| ``` | |||||
| Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. |
| name: Bulma Document | |||||
| description: > | |||||
| Template for documents to be published as Bulma Markdown Documents. | |||||
| create_dir: false |
| % Generated by roxygen2: do not edit by hand | |||||
| % Please edit documentation in R/bulma_document.R | |||||
| \name{bulma_document} | |||||
| \alias{bulma_document} | |||||
| \title{Bulma Document Renderer} | |||||
| \usage{ | |||||
| bulma_document(..., css = NULL, pandoc_args = NULL) | |||||
| } | |||||
| \arguments{ | |||||
| \item{...}{Arguments passed on to \code{rmarkdown::html_document_base} | |||||
| \describe{ | |||||
| \item{smart}{Produce typographically correct output, converting straight | |||||
| quotes to curly quotes, --- to em-dashes, -- to en-dashes, and ... to | |||||
| ellipses.} | |||||
| \item{theme}{Visual theme ("default", "cerulean", "journal", "flatly", | |||||
| "readable", "spacelab", "united", "cosmo", "lumen", "paper", "sandstone", | |||||
| "simplex", or "yeti"). Pass \code{NULL} for no theme (in this case you can | |||||
| use the \code{css} parameter to add your own styles).} | |||||
| \item{self_contained}{Produce a standalone HTML file with no external | |||||
| dependencies, using data: URIs to incorporate the contents of linked | |||||
| scripts, stylesheets, images, and videos. Note that even for self contained | |||||
| documents MathJax is still loaded externally (this is necessary because of | |||||
| its size).} | |||||
| \item{lib_dir}{Directory to copy dependent HTML libraries (e.g. jquery, | |||||
| bootstrap, etc.) into. By default this will be the name of the document with | |||||
| \code{_files} appended to it.} | |||||
| \item{mathjax}{Include mathjax. The "default" option uses an https URL from a | |||||
| MathJax CDN. The "local" option uses a local version of MathJax (which is | |||||
| copied into the output directory). You can pass an alternate URL or pass | |||||
| \code{NULL} to exclude MathJax entirely.} | |||||
| \item{pandoc_args}{Additional command line options to pass to pandoc} | |||||
| \item{template}{Pandoc template to use for rendering. Pass "default" to use | |||||
| the rmarkdown package default template; pass \code{NULL} to use pandoc's | |||||
| built-in template; pass a path to use a custom template that you've created. | |||||
| Note that if you don't use the "default" template then some features of | |||||
| \code{html_document} won't be available (see the Templates section below for | |||||
| more details).} | |||||
| \item{dependency_resolver}{A dependency resolver} | |||||
| \item{copy_resources}{Copy resources} | |||||
| \item{extra_dependencies}{Extra dependencies} | |||||
| \item{bootstrap_compatible}{Bootstrap compatible} | |||||
| }} | |||||
| } | |||||
| \description{ | |||||
| Bulma Document Renderer | |||||
| } |
| @Book{xie2015, | |||||
| title = {Dynamic Documents with {R} and knitr}, | |||||
| author = {Yihui Xie}, | |||||
| publisher = {Chapman and Hall/CRC}, | |||||
| address = {Boca Raton, Florida}, | |||||
| year = {2015}, | |||||
| edition = {2nd}, | |||||
| note = {ISBN 978-1498716963}, | |||||
| url = {http://yihui.name/knitr/}, | |||||
| } | |||||
| @Manual{R-base, | |||||
| title = {R: A Language and Environment for Statistical Computing}, | |||||
| author = {{R Core Team}}, | |||||
| organization = {R Foundation for Statistical Computing}, | |||||
| address = {Vienna, Austria}, | |||||
| year = {2016}, | |||||
| url = {https://www.R-project.org/}, | |||||
| } |
| --- | |||||
| title: "Bulma Test" | |||||
| subtitle: "A minimal Bulma RMarkdown Template" | |||||
| author: | |||||
| - name: Garrick Aden-Buie | |||||
| url: https://garrickadenbuie.com | |||||
| extra: | |||||
| - "Moffitt Cancer Center" | |||||
| - "[@grrrck](https://twitter.com/grrrck)" | |||||
| - name: Travis Gerke | |||||
| url: https://travisgerke.com | |||||
| extra: | |||||
| - "Moffitt Cancer Center" | |||||
| - "@travisgerke" | |||||
| date: "12/7/2018" | |||||
| header-links: | |||||
| - name: Github | |||||
| url: https://github.com/gerkelab | |||||
| - name: Home | |||||
| url: https://gerkelab.com | |||||
| # bulma: | |||||
| # hero: ["dark", "bold"] | |||||
| output: | |||||
| bulmaRmd::bulma_document: default | |||||
| # css: custom.css | |||||
| html_document_base: | |||||
| pandoc_args: ["--template", "/Users/4468739/work/bulmaRmd/inst/bulma/bulma-min.html" ] | |||||
| md_document: default | |||||
| bibliography: bibfile.bib | |||||
| --- | |||||
| ```{r setup, include=FALSE} | |||||
| knitr::opts_chunk$set(echo = TRUE) | |||||
| ``` | |||||
| <!-- | |||||
| <div class="level"> | |||||
| <div class="level-item has-text-centered"> | |||||
| <div> | |||||
| <p class="title is-5">Garrick Aden-Buie</p> | |||||
| <p class="subtitle is-6">Moffitt Cancer Center<br>@grrrck<br>garrickadenbuie.com</p> | |||||
| </div> | |||||
| </div> | |||||
| <div class="level-item has-text-centered"> | |||||
| <div> | |||||
| <p class="title is-5">Travis Gerke</p> | |||||
| <p class="subtitle is-6">Moffitt Cancer Center<br>@travisgerke<br>travisgerke.com</p> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| --> | |||||
| A bit of an _introduction_ here. We no longer need to start an article by writing this: | |||||
| ```latex | |||||
| \documentclass{article} | |||||
| \begin{document} | |||||
| \end{document} | |||||
| ``` | |||||
| # Start with a cool section | |||||
| You can use traditional **Markdown** syntax, such as [links](http://yihui.name/knitr) and `code`. Here is a quote: | |||||
| > A girl phoned me the other day and said "Come on over, there's nobody home." I went over. Nobody was home. -- Rodney Dangerfield | |||||
| # Followed by another section | |||||
| Of course you can write lists: | |||||
| - apple | |||||
| - pear | |||||
| - banana | |||||
| Or ordered lists: | |||||
| 1. items | |||||
| 1. will | |||||
| 1. be | |||||
| 1. ordered | |||||
| - nested | |||||
| - items | |||||
| # Okay, some R code | |||||
| ```{r linear-model} | |||||
| fit = lm(dist ~ speed + I(speed^2), data = cars) | |||||
| b = coef(fit) # coefficients | |||||
| summary(fit) | |||||
| ``` | |||||
| The code will be highlighted in all output formats. | |||||
| # And some pictures | |||||
| ```{r lm-vis, fig.cap='Regression diagnostics', fig.height=5} | |||||
| par(mfrow = c(2, 2), pch = 20, mar = c(4, 4, 2, .1), bg = 'white') | |||||
| plot(fit) | |||||
| ``` | |||||
| # A little bit math | |||||
| Our regression equation is $Y=`r b[1]`+`r b[2]`x$, and the model is: | |||||
| $$ Y = \beta_0 + \beta_1 x + \epsilon$$ | |||||
| # Pandoc extensions {.tabs} | |||||
| ## Definition lists | |||||
| Programmer | |||||
| : A programmer is the one who turns coffee into code. | |||||
| LaTeX | |||||
| : A simple tool that is nothing but a couple of backslashes. | |||||
| ## Examples | |||||
| We have some examples. | |||||
| (@) Think what is `0.3 + 0.4 - 0.7`. Zero. Easy. | |||||
| (@weird) Now think what is `0.3 - 0.7 + 0.4`. Still zero? | |||||
| People are often surprised by (@weird). | |||||
| ## Tables | |||||
| A table here. | |||||
| Table: Demonstration of simple table syntax. | |||||
| Right Left Center Default | |||||
| ------- ------ ---------- ------- | |||||
| 12 12 12 12 | |||||
| 123 123 123 123 | |||||
| 1 1 1 1 | |||||
| You can also generate tables easily using `knitr::kable()` or the **pander** package. | |||||
| ```{r} | |||||
| knitr::kable(head(iris)) | |||||
| ``` | |||||
| ## Footnotes | |||||
| We can also write footnotes[^1]. | |||||
| [^1]: hi, I'm a footnote | |||||
| Or write some inline footnotes^[as you can see here]. | |||||
| ## Citations | |||||
| We compile the R Markdown file to Markdown through **knitr** [@xie2015] in R [@R-base]. For more about @xie2015, see <http://yihui.name/knitr>. | |||||
| <div class="tabs is-left is-boxed is-fullwidth"> | |||||
| <ul> | |||||
| <li class="is-active"><a>Pictures</a></li> | |||||
| <li><a>Music</a></li> | |||||
| <li><a>Videos</a></li> | |||||
| <li><a>Documents</a></li> | |||||
| </ul> | |||||
| </div> | |||||
| # References |
| body { | |||||
| font-family: "PT Sans"; | |||||
| } |