ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

HTML Crush Switch

by pcaro90 ST2

HTML code crush: turn it on for uploading, turn it off for working. Keep the web small and the code easy on the eyes.

Details

  • 2013.03.10.17.58.24
  • bitbucket.​org
  • 8 years ago
  • 2 hours ago
  • 7 years ago

Installs

  • Total 306
  • Win 214
  • Mac 73
  • Linux 19
Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
bitbucket.​org

HTML Crush Switch

Summary

HTML code crush: turn it on for uploading, turn it off for working. Keep the web small and the code easy on the eyes.

Warning

Take care with PHP and Javascript embedded codes! The crush process COULD mess them up. It is always a good practice to separate the PHP and Javascript code in separate documents, so you can use a specific crusher for each type. In any case, you should ALWAYS test the webpage after crushing it.

How do I switch?

You can switch the crush ON and OFF with the command palette (by default, cmd+shift+p in OS X and ctrl+shift+p in Windows and Linux). The commands are called with “HTML Crush Switch ON” and “HTML Crush Switch OFF”.

What the switch does?

Crush ON:

  • HTML Comments removed ()
  • JS/PHP Multiline comments removed (/* comment */)
  • Indentations and trailing spaces removed.
  • New line characters removed if they are after…
    • a HTML tag closer (>)
    • a semicolon, for JS and PHP (;)
    • an open or close brace ({})
    • a simple or double quote ('“)

Crush OFF:

  • Separates the code into lines:
    • Separates HTML tags.
    • New line after semicolon or braces.
    • Tries to keep HTML singletons in their own line.
    • Tries to keep small tags in one line.
  • Reindent the code, using a specific algorithm (default) or using the ST 'reindent' function.

Changelog

v1.0 - 2012/03/10

Initial version