AnWeber / atom-htmltidy

Atom Package to tidy up HTML with HTML Tidy 5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NO ACTIVE DEVELOPMENT

Sorry, this extension is out of business. It has errors on linux system and I need to setup a new linux vm. Maybe it is working on win systems but I switched to vs code as default editor and got no time to continue developing this extension. If someone got time to develop this extension, feel free to use the sources.

atom-htmltidy

Lint and Format HTML using Tidy-HTML5

Install

$ apm install atom-htmltidy

Or, Settings → Install → Search for atom-htmltidy

Usage

use Keybinding ctrl-alt-1

There's a format on save option in the settings to activate format on save for html files.

Open the Command Palette and type atom-htmltidy.

Settings

  • default options: if no tidy html 5 options file is found, this options will be used default: none
  • dynamic new-blocklevel-tags: all tags with an - in the tag name are added to the tidy html 5 option new-blocklevel-tags, e.g. angular js bootstrap 'uib-alert' default: disabled
  • dynamic show-body-only: the html tidy 5 option is set to true, if a body tag exists default: disabled
  • enable linter: lint files with html tidy default: enabled
  • enable file search: the options for tidy html 5 is loaded from a json file default: enabled
  • filename of tidy html 5 options: name of the tidy html 5 options file default: .htmltidy
  • format on save: auto format html document on save default: enabled
  • grammer scopes: array of grammar scopes on which formatting and linting gets activated default: angular, basic, erb, gohtml, jsp, mustache, handlebars, ruby, php
  • path to tidy executable: the package has a builtin version of tidy html 5 (v5.1.25). if you want to use a newer version, this is your setting. default: none
  • show errors: automatically set show-errors to 6 if no option is provided default: enabled
  • warn on tag count change: if the tag count change during formatting, a warn notification gets displayed. tidy html 5 automatically delete or add html tags. it is a feature. default: disabled

Please provide tidy html 5 options. I don't recommend using empty options. I use this options in an angularjs project.

{

	"markup" : true,
	"output-xml" : false,
	"input-xml" : true,
	"show-warnings" : true,
	"numeric-entities" : false,
	"quote-marks" : false,
	"quote-nbsp" : true,
	"quote-ampersand" : false,
	"break-before-br" : false,
	"preserve-entities" : true,
	"uppercase-tags" : false,
	"uppercase-attributes" : false,
	"indent" : "auto",
	"indent-with-tabs" : false,
	"indent-attributes" : true,
	"sort-attributes" : "alpha",
	"wrap" : 200
}

A full list of available Options: Tidy-HTML5

License

MIT © Andreas Weber

Credits

About

Atom Package to tidy up HTML with HTML Tidy 5

License:MIT License


Languages

Language:JavaScript 100.0%