GithubHelp home page GithubHelp logo

evamaerey / doublecrochet Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 0.0 5.84 MB

Show .Rmd source paired with output!

Home Page: https://evamaerey.github.io/doublecrochet

License: Other

R 2.54% JavaScript 88.76% CSS 8.70%

doublecrochet's Introduction

Introducing {doublecrochet}

Lifecycle: experimental

Rmarkdown files are so cool. They let you to combine prose, code, and code output in a single output file. And getting up and running with .Rmds is pretty easy — learn bit about code chunks, a bit of markdown and you are good to go.

But there is a lot that you can do in .Rmds beyond the basics. So you may feel .Rmd admiration and wonder at the products of more advanced users. How did they to that?

Or maybe as an advanced user you might get asked: How did you produce those slides, poster, dashboard etc.? You can answer ‘xaringan’ or ‘knitr’, but can you deliver ‘the how-to goods’ in a detailed way when you get this question? (Another common sensation, looking back at your own work, may be ‘how did I get that done?’)

The goal of doublecrochet is to help produce a companion output from your .Rmd – one that has .Rmd source snippets quoted close to the rendered output.

The package now focused a case where there are natural breakpoints – slideshows! Quoted source is presented on a slide, then the rendered content is shown.

Check out doublecrochet’s in action below. The first set of slides is a slide show of ‘Cool Xaringan Stuff’, and the second is the Double Crochetted version that quotes the slide source.

Compare

Cool Xaringan Stuff Open in New tab

<iframe src="https://evamaerey.github.io/doublecrochet/cool_xaringan_stuff.html" frameborder="2" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position:absolute;top:0;left:0;width:100%;height:100%;" allowtransparency="true"> </iframe>

… with the Double Crocheted version

Cool Xaringan Stuff Double Crocheted View in new tab:

<iframe src="https://evamaerey.github.io/doublecrochet/cool_xaringan_stuff_double_crochet.html" frameborder="2" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position:absolute;top:0;left:0;width:100%;height:100%;" allowtransparency="true"> </iframe>

Motivation

Inspiration for this project was creating Easy Flipbooks Recipes where I was quoting my source a bunch w/ copy paste and fancy fencing. I only got through 4 ‘recipes’. But there were more ‘recipes’ that I’d like to share.

Having ‘doublecrochet’ working should be nice for communicating about how to use flipbookr – and other cool xaringan-complementary packages.

2022 update: Now quoting the .Rmd verbatim is done using the new verbatim engine from knitr!

Installation

The development version from GitHub with:

# install.packages("remotes")
remotes::install_github("EvaMaeRey/doublecrochet")

Example

For now doublecrochet::crochet() is intended for use with xaringan .Rmd slide show files:

library(doublecrochet)

## a text .rmd file stored on github
download.file(
  url = "https://raw.githubusercontent.com/EvaMaeRey/doublecrochet/master/inst/rmarkdown/templates/double-crochet/skeleton/skeleton.Rmd", 
  destfile = "docs/cool_xaringan_stuff.Rmd")

# regular render of xaringan .Rmd 
rmarkdown::render(input = "docs/cool_xaringan_stuff.Rmd")

# double crochet render
doublecrochet::crochet(input = "docs/cool_xaringan_stuff.Rmd", render = T)
                      

Once you have the ‘doublecrochet’ version of your .Rmd, you can try to compile and render this and you’ll have html output. Source will be quoted throughout.

Scope

Doublecrochet doesn’t do a good job of showing bigger picture and global style changes in a file.

doublecrochet's People

Contributors

evamaerey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

doublecrochet's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.