Skip to content

Latest commit

 

History

History
103 lines (89 loc) · 2.69 KB

README.md

File metadata and controls

103 lines (89 loc) · 2.69 KB

Beautify js

js beautify for komodo edit/ide.

This little beautifier will reformat css, html and javascript.
Based on the the jsbeautifier.org.

Usage

Goto to Tools -> Beautify js and select an option, or right-click on your file (context menu)

  • Beautify (auto detect)
    Beautify HTML/CSS/javascript (this will be auto-detected).
    Selection or document
  • Beautify HTML
    Beautify HTML.
    Selection or document
  • Beautify CSS
    Beautify CSS.
    Selection or document
  • Beautify Javascript
    Beautify javascript.
    Selection or document
  • Minify Javascript
    Minify javascript.
    Selection or document
  • Minify Javascript save as .min
    Minify javascript and save it as .min file.
    document
  • Minify CSS
    Minify CSS.
    Selection or document
  • Minify CSS save as .min
    Minify CSS and save it as .min file.
    document
  • Beautify Settings
    This will open the settings window.
    Selection or document

Ide only

Same menu is availible under **code > format > beautify js**

Options

The option panel is accessible true the add on screen.

![screenshot option panel](https://raw.githubusercontent.com/babobski/Beautify-js/master/screenshot.png)

Key Bindings

You can set up key bindings for all of the available beautify options. Preferences > Key Bindings > Beautify ![screenshot key bindings](screenshot2.png)

Userscripts

You can use beautify js inside a userscript, below are a few example's how to set up such userscript.
// AUTO DETECT (JS/HTML/CSS)
if (extensions.beautifyjs) {
    extensions.beautifyjs.beautify();
}
// HTML
if (extensions.beautifyjs) {
    extensions.beautifyjs.beautify_HTML();
}

// CSS
if (extensions.beautifyjs) {
    extensions.beautifyjs.beautify_CSS();
}

// Javascript
if (extensions.beautifyjs) {
    extensions.beautifyjs.beautify_JS();
}

// Minify Javascript
if (extensions.beautifyjs) {
    extensions.beautifyjs.jsMin();
}

// Minify CSS
if (extensions.beautifyjs) {
    extensions.beautifyjs.cssMin();
}

// Minify Javascript ans save it as .min
if (extensions.beautifyjs) {
    extensions.beautifyjs.jsMinSave();
}

// Minify CSS ans save it as .min
if (extensions.beautifyjs) {
    extensions.beautifyjs.cssMinSave();
}