MyNixOS website logo
Description

'RStudio' Addins to Prettify 'JavaScript', 'C++', 'Python', and More.

Provides 'RStudio' addins to prettify 'HTML', 'CSS', 'SCSS', 'JavaScript', 'JSX', 'Markdown', 'C(++)', 'LaTeX', 'Python', 'Julia', 'XML', 'Java', 'JSON', 'Ruby', and to reindent 'C(++)', 'Fortran', 'Java', 'Julia', 'Python', 'SAS', 'Scala', 'Shell', 'SQL' and "TypeScript". Two kinds of addins are provided: 'Prettify' and 'Indent'. The 'Indent' addins only reindent the code, while the 'Prettify' addins also modify the code, e.g. trailing semi-colons are added to 'JavaScript' code when they are missing.

prettifyAddins

R-CMD-check

RStudio addins to prettify JavaScript / HTML / CSS / Markdown / C++ and more.

JavaScript example:

The Markdown prettifier also prettifies the code blocks:

NEWS

  • As of version 1.0.0, there are six addins:

The 'shiny' addins are the ones you can see on the above GIFs. The other ones are not interactive. The 'Prettify C/C++/Java' addin requires clang-format (it is possible to reindent C/C++/Java (and more) with the 'Indent (shiny)' addin).

  • As of version 2.0.0, there are five new addins:
    • 'Indent (PhantomJS)': allows to reindent code for some languages which were supported by the 'Indent (shiny)' addin only, whereas this addin does not run a Shiny app; these languages are C, C++, Java, Fortran, Julia, Python, SAS, Scala, Shell, and SQL. This addin requires phantomjs (the package provides a function to install this software).
    • 'Prettify LaTeX': to prettify LaTeX code; works for Sweave code. It requires latexindent, which is included in MikTeX and TeX Live distributions.
    • 'Prettify Julia': to prettify Julia code. It requires Julia.
    • 'Prettify Python': to prettify Python code. It requires black.
    • 'Prettify (formatCodeApi)': to prettify Java, JSON, and Ruby.

Moreover, this version exports the functions used to prettify/reindent. For example:

code <- c(
  "function f(x){",
  "return x+1",
  "}"
)
cat(prettify_V8(code, "javascript"))

gives

function f(x) {
  return x + 1;
}

Copies of license agreements

The 'prettifyAddins' package as a whole is distributed under GPL-3 (GNU GENERAL PUBLIC LICENSE version 3).

It includes other open source software components:

  • Prettier, https://github.com/prettier/prettier
  • indent.js, https://github.com/zebzhao/indent.js
  • CodeMirror, https://github.com/codemirror/CodeMirror
  • SQL Formatter, https://github.com/zeroturnaround/sql-formatter
  • Prettydiff, https://github.com/prettydiff/prettydiff

Full copies of the license agreements used by these components are included in the file LICENSE.note.

Metadata

Version

2.6.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows