Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/EvaMaeRey/flipbookr
Presenting code step-by-step and side-by-side with its output
https://github.com/EvaMaeRey/flipbookr
Last synced: 3 months ago
JSON representation
Presenting code step-by-step and side-by-side with its output
- Host: GitHub
- URL: https://github.com/EvaMaeRey/flipbookr
- Owner: EvaMaeRey
- License: other
- Created: 2019-11-07T01:23:57.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-16T17:52:13.000Z (12 months ago)
- Last Synced: 2024-06-22T20:22:15.496Z (5 months ago)
- Language: CSS
- Homepage: https://evamaerey.github.io/flipbookr/
- Size: 12.2 MB
- Stars: 196
- Watchers: 7
- Forks: 19
- Open Issues: 10
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - EvaMaeRey/flipbookr - Presenting code step-by-step and side-by-side with its output (CSS)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# The flipbookr package
“Flipbooks” present side-by-side, aligned, incremental
code-output evolution via automated code parsing and reconstruction.
Like physical flipbooks, they let the 'reader' watch a scene evolve at
their own pace. Flipbooks seek to reduce the guesswork involved
between code and its behavior by presenting substeps of a coding
pipeline; the reader of a flipbook observes the partial code that is
used to create “A.1”, “A.2”, “A.3” etc. all the way up to “B”.Here's the 'minimal flipbook' template that's available with the package:
[View flipbook in a new tab](https://evamaerey.github.io/flipbookr/minimal_flipbook.html){target="_blank"}
```{r, echo = F, out.width="75%", fig.align='center'}
knitr::include_graphics("https://evamaerey.github.io/flipbookr/minimal_flipbook.gif")
```The create a flipbook isn't hard because parsing and reconstruction of code
pipelines into substeps is automated!flipbookr's `chunk_reveal()` disassembles a single code chunk and creates the "build" of multiple partial-code chunks on different slides (the --- is automatically generated for you too).
Check out the details on how to do this in this [*doublecrocheted* version of the same flipbook](https://evamaerey.github.io/flipbookr/minimal_flipbook_double_crochet.html){target="_blank"} (quotes the .Rmd source on some slides).
## Installation
You can install the development version of flipbookr with devtools as
follows:``` r
devtools::install_github("EvaMaeRey/flipbookr")
```You will most likely use this package with the rmarkdown presentation
tool, Xaringan, which is available on CRAN:``` r
install.packages("xaringan")
```## Template
The package includes several templates for building a flipbook that
demonstrates various flipbooking modes.The templates can be accessed from within RStudio. For example: New File -\> RMarkdown -\> From Template -\> A Minimal Flipbook. The templates are:
- A Minimal Flipbook
- Most Flipbookr Features, [preview output](https://raw.githubusercontent.com/EvaMaeRey/flipbookr/master/inst/rmarkdown/templates/minimal-flipbook/skeleton/skeleton.Rmd){target="_blank"}
- A Python Flipbook## How it works:
[Here's](https://evamaerey.github.io/flipbooks/flipbookr/flipbookr_building_blocks#1) a flipbook going through some of the internal flipbookr functions.
```{r sample_chunk}
library(tidyverse)
Titanic %>%
data.frame() %>%
uncount(Freq) %>%
ggplot() +
aes(x = Sex) +
geom_bar(position = "fill") +
aes(fill = Survived)
```## Coming soon
```{r, eval = F}
chunk_reveal_live(chunk_name = "sample_chunk")
```# how am I using rstudioapi wrong?
```{r}
download.file(url = "https://evamaerey.github.io/flipbookr/", destfile = "myhtml.html")
rstudioapi::viewer("myhtml.html")
```