prettify_FCA: Prettify Java, JSON or Ruby

View source: R/prettify_FCA.R

prettify_FCAR Documentation

Prettify Java, JSON or Ruby

Description

Prettify Java code, JSON code or Ruby code.

Usage

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

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 Sept. 14, 2023, 5:06 p.m.