https://github.com/desiquintans/andesine
My personal RMarkdown template for producing nice analyses. Readable theme, easy-to-distinguish code blocks, and colourblind-friendly syntax highlighting options.
https://github.com/desiquintans/andesine
r rmarkdown rmarkdown-template rstudio
Last synced: about 1 year ago
JSON representation
My personal RMarkdown template for producing nice analyses. Readable theme, easy-to-distinguish code blocks, and colourblind-friendly syntax highlighting options.
- Host: GitHub
- URL: https://github.com/desiquintans/andesine
- Owner: DesiQuintans
- License: mit
- Created: 2022-10-18T09:32:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-19T05:15:44.000Z (over 3 years ago)
- Last Synced: 2025-02-06T12:48:04.494Z (over 1 year ago)
- Topics: r, rmarkdown, rmarkdown-template, rstudio
- Language: HTML
- Homepage:
- Size: 1.53 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# andesine: Readable and colourblind-friendly HTML output for R Markdown
# [See an example document here](https://rawcdn.githack.com/DesiQuintans/andesine/f168f30b0e4fd2126cad6b07f5557c195bbd3f26/example.html)
## Features
I (Desi) made this template to fit with as MS Word stylesheet I've been using for a while, and which is sort of becoming my personal brand. Besides that, it also deals with some shortcomings of the built-in themes and highlighters that have gotten me confused in the past.
1. Body text rendered in [Atkinson Hyperlegible](https://brailleinstitute.org/freefont) for easy reading.
2. Code rendered in [Hack](https://sourcefoundry.org/hack/).
3. Two syntax highlighting themes provided, one **colourblind-friendly** based on my [Pebble-safe RStudio editor theme](https://github.com/DesiQuintans/Pebble-safe/), and one *not** colourblind-friendly that is modified from Pandoc's *breezedark* highlighter. This readme is outputting with the Pebble-safe highlighter.
4. Dark code blocks and light output blocks make it instantly obvious which is which.
5. Visually prominent headings with more whitespace help when skimming through the document.
6. Basic sanities set up in the template ('last compiled' time, `sessioninfo()` dump, automated installation of my package manager [`librarian`](https://github.com/DesiQuintans/librarian)).
# Installation
Install `andesine` from GitHub:
```r
install.packages("remotes")
remotes::install_github("DesiQuintans/andesine")
```
# Usage
To make a new document, go to `File` → `New File` → `R Markdown...` → `From Template` → `Andesine (HTML)`.
This template does not use the 'theme' or 'css' YAML fields. Instead, it uses the `breezedark` highlighter to add style tags to the output HTML, and then the document is styled and highlighted by CSS that is embedded at the very end of the template (use code folding to see the CSS chunks' names more clearly).
Yes, the CSS is embedded, and not in external files. I did it this way so that the template itself was a single file, otherwise each new andesine document would have to be created in its own folder to accommodate the external files.
## Choosing a syntax highlighter
There are two syntax highlighting options included as CSS chunks at the end of the template:
1. `highlight_andesine_dark`, not colourblind-friendly. Modified from `breezedark` to make the function names easier to see against the dark background.
2. **(Default)** `highlight_pebblesafe_dark`, colourblind-friendly. Based on my [Pebble-safe RStudio editor theme](https://github.com/DesiQuintans/Pebble-safe/).
The last highlighting CSS chunk to appear in the document is what gets used.