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
  • 1 hour ago
  • 7 years ago

Installs

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