Skip to content

Instantly share code, notes, and snippets.

@dereksz
Last active August 25, 2021 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dereksz/45c8d27efcb87fb6222926ce08a5fcee to your computer and use it in GitHub Desktop.
Save dereksz/45c8d27efcb87fb6222926ce08a5fcee to your computer and use it in GitHub Desktop.
My custom CSS file for my RMarkdown Documents
/* This file is primarily concerned with using the full width of the web
browsers screen; plus some nice fonts that are especially good for
code rendering.
*/
div.main-container {
max-width: none !important;
max-width: none !important;
margin-left: 0px !important;
margin-right: 0px !important;
}
#content{
background:#fcfcfc;
height:100%;
margin-left:300px;
max-width: none !important;
min-height:100%;
}
body {
font-family: "Noto Serif", "serif" !important;
}
code {
font-family: "JuliaMono", "monospace" !important;
}
---
title: "..."
author: "..."
date: "`r format(Sys.time(), '%d %B %Y (%X)')`"
output:
rmdformats::readthedown:
keep_md: true
self_contained: false
toc_depth: 6
toc_collapsed: no
df_print: paged
css: my.css
lib_dir: libs
includes:
after_body: disqus.html
---
```{r setup, include=FALSE}
options(scipen=1000)
knitr::opts_chunk$set(echo=FALSE, cache=TRUE)
# "Fake" engines, mainly for formatting & code-folding
knitr::knit_engines$set(yaml=function(options) paste("```yaml",paste0(options$code, collapse = "\n"),"```",sep="\n"))
library(pacman)
p_load(dplyr, dbplyr, tidyr)
p_load(magrittr)
p_load(ggplot2, scales, ggrepel)
p_load(purrr)
p_load(DT)
p_load(knitr, pander)
p_load(reticulate)
p_load(lubridate)
source('functions.R')
```
# Connect
```{r connection}
if (!exists("con")) {
message("Creating new connection")
con <- ...
created_connection <- TRUE
} else {
message("Reusing connection")
}
```
# Take Down
## Disconnect
```{r disconnect, cache=FALSE, echo=TRUE, class.source = "fold-show"}
if (created_connection) {
dbDisconnect(con)
rm(con)
}
```
## sessionInfo
```{r echo=FALSE, class.source = "fold-show"}
p_load(sessioninfo)
session_info()
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment