prettify_FCA: Prettify Java, JSON or Ruby

Description Usage Arguments Value Note Examples

View source: R/prettify_FCA.R

Description

Prettify Java code, JSON code or Ruby code.

Usage

1
prettify_FCA(contents = NA, language = NA)

Arguments

contents

the code to be prettified; there are three possibilities for this argument: NA (default), to use the file currently opened in RStudio; the path to a file; or the code given as a character vector

language

the language of the code, such as "json"; see getPrettifiableLanguages; if the contents are read from a file and language=NA, then the language is guessed from the file extension

Value

The pretty code in a character string.

Note

This function requires a connection to Internet.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(prettifyAddins)

code <- c(
  "{a: [0,1,  2   ],",
  "f:  function( x){return x+1}}" # this function will be prettified too
)

## Not run: 
cat(prettify_FCA(code, "json"))
## End(Not run)

prettifyAddins documentation built on Jan. 25, 2022, 5:09 p.m.