Just keep up one rule: 80 characters per line. I promise it will take 80% of your time. -- Lorenz Walthert
The main motivation for creating this package was because when working with bookdown / blogdown or Rmarkdown in general, I spent way too much time just keeping up the 80 character width rule as every word you add or remove in a paragraph affects all subsequent lines.
Functionality
This package is similar to styler, but it styles non-code elements and files and
it does really just one thing: Making every line at most 80 characters, or a
custom line width you can set with the option stylermd.line_width
, i.e.
options(stylermd.line_width = 60)
. It supports:
You can install it from GitHub:
remotes::install_github("lorenzwalthert/stylermd")
API
You can use:
tidy_text()
.tidy_file()
.save_after_styling
to TRUE
, for
example in your .Rprofile
to enable saving after styling. Hint: Assign a
keyboard short-cut for the Addin with Menu -> Tools -> Modify Keyboard
Shortcuts for most productive use.Example
library(magrittr) text <- "1. introduced above. We do this by first creating a style guide with the designated wrapper function `create_style_guide()`. It takes transformer" stylermd::tidy_text(text) %>% cat(sep = "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.