This package builds on styler by
providing a third-party style guide that can be applied to code with
styler’s code formatters such as style_text()
.
Let’s see an example
# remotes::install_github("lorenzwalthert/oneliner")
library(oneliner)
style_text(
"sum <- function(x, y) {
x + # hi
y
}
1 + 1",
style = one_line_style
)
#> sum<-function(x,y){x+y};1+1
The name of the style guide is self-explanatory. Put all code on one line. Advantages of the style guide proposed include:
I am sure I have convinced you that this style guide rocks. This is for real programmers. All code on one line. No spaces or comments. I am serious. Use this style guide to format your code like nerds do.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.