Skip to content

A collection of tools to support the creation and styling of content on {distill} websites

Notifications You must be signed in to change notification settings

karlmakepeace/distilltools

 
 

Repository files navigation

distilltools

distilltools is collection of tools to support the creation and styling of content on websites created using the distill package in R.

It is in the very early stages of development. I am actively seeking contributions - both ideas and code - to help build the package to be broadly useful to a wide variety of distill users. The idea is for the package to become a curated, collaborative, community-driven project. In terms of relationship between packages, I hope in time that distilltools can be for distill something like what xaringanExtra and xaringanthemer are for xaringan. Some of what I have in mind may sit better within the distill package itself, and I will be reaching out to the distill team about that.

Update (2022-05-29)

Development on distilltools has been on a bit of a hiatus recently, but I will resume work on it. When I do, I want to ensure the package also has the functionality to support websites created in R with Quarto, and so I may also rename the package.

An article on distilltools, and my intentions for it, is featured in The Future of Sata Science anthology (written October 2021, published June 2022).

Installation

# install.packages("remotes")
# requires remotes >= 2.2
remotes::install_github("EllaKaye/distilltools")

# for remotes < 2.2
remotes::install_github("EllaKaye/distilltools", ref = "main")

Functionality

There are currently five exported functions in distilltools.

Blogging functions

  • create_post_from_template(): this function works almost identically to distill::create_post(), but extends it with an added path argument that specifies an .Rmd file to use as a template for the post. This function can also be run interactively using the Create post (from template) RStudio addin. See ?create_post_from_template and ?available_templates for details on using your R Markdown templates with the addin.
  • available_templates(): lists a named vector of available R Markdown templates for new posts, talks, etc.
  • create_talk(): a wrapper around distill::create_post() that creates a post in the talk directory and includes buttons (made with icon-link()) for slides (both web and pdf), material, video and project. These can easily be edited in the resulting .Rmd file. This function was inspired by Eric Ekholm’s blog post.

Styling functions

  • icon_link(): creates the html for a link button with icon and text. Output of icon_link will need styling via the icon-link class to make it look like a button. For more details on this function, see this blog post from John Paul Helveston. For examples of styling the icon-link class, see John Paul Helveston’s css and Ella Kaye’s css.
  • modify_default_highlighting(): allows the user to swap the five colours used in {distill}’s default syntax highlighting scheme with five colours of their choice, and saves the resulting .theme file into the working directory.

Future functionality

Plans for future functionality include:

Contributing to distilltools

We’re actively seeking contributions!

  • Do you have a distill website? If so, what tools would you help you in the creation, upkeep and styling of your site? Let us know by with an issue.
  • Do you have functions that you’ve written for your distill workflow? If they help you, they’ll almost certainly be helpful to others to. Consider submitting (generalized) versions of them for inclusion in distilltools!

There are lots of other ways to support and contribute to distilltools. Please see the contributing guide for more details.

Code of Conduct

Please note that the distilltools project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

About

A collection of tools to support the creation and styling of content on {distill} websites

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%