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
  • 7 years ago
  • 2 hours ago
  • 7 years ago

Installs

  • Total 306
  • Win 214
  • Mac 73
  • Linux 19
May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15
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