Skip to content

Commit cc8d53f

Browse files
committed
Initial commit.
0 parents  commit cc8d53f

File tree

6 files changed

+110
-0
lines changed

6 files changed

+110
-0
lines changed

.sublimelinterrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"linters": {
3+
"flake8": {
4+
"max-line-length": 120
5+
},
6+
"pep8": {
7+
"max-line-length": 120
8+
}
9+
}
10+
}

LICENSE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a copy
2+
of this software and associated documentation files (the "Software"), to deal
3+
in the Software without restriction, including without limitation the rights
4+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5+
copies of the Software, and to permit persons to whom the Software is
6+
furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in
9+
all copies or substantial portions of the Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17+
THE SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
SublimeLinter-html-tidy
2+
=========================
3+
4+
This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter3) provides an interface to tidy (either the [html4](http://tidy.sourceforge.net) or [html5]() version). It will be used with files that have the “HTML” syntax.
5+
6+
## Installation
7+
8+
### Linter installation
9+
Before installing this plugin, you must ensure that `tidy` is installed on your system.
10+
11+
- **Mac OS X**`tidy` comes preinstalled on recent versions of Mac OS X. You can install a more recent version by using [Homebrew](http://brew.sh) and `brew install homebrew/dupes/tidy`.
12+
13+
- **Linux** – You should be able to install tidy using the system’s package manager. For example, on Debian-based systems (including Ubuntu), you can install with `sudo apt-get install tidy`.
14+
15+
- **Windows** – A Windows binary is available [here](http://www.paehl.com/open_source/?HTML_Tidy_for_Windows).
16+
17+
On Mac OS X and Linux, you can also try building the experimental [html5 tidy](https://github.com/w3c/tidy-html5).
18+
19+
Once tidy is installed, you can proceed to install the SublimeLinter-html-tidy plugin.
20+
21+
### Plugin installation
22+
Please use [Package Control](https://sublime.wbond.net/installation) to install the linter plugin. This will ensure that the plugin will be updated when new versions are available. If you want to install from source so you can modify the source code, you probably know what you are doing so we won’t cover that here.
23+
24+
To install via Package Control, do the following:
25+
26+
1. Within Sublime Text, bring up the [Command Palette](http://docs.sublimetext.info/en/sublime-text-3/extensibility/command_palette.html) and type `install`. Among the commands you should see `Package Control: Install Package`. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins.
27+
28+
1. When the plugin list appears, type `html-tidy`. Among the entries you should see `SublimeLinter-html-tidy`. If that entry is not highlighted, use the keyboard or mouse to select it.
29+
30+
## Settings
31+
For general information on how SublimeLinter works with settings, please see [Settings](https://github.com/SublimeLinter/SublimeLinter.github.io/wiki/Settings). For information on generic linter settings, please see [Linter Settings](https://github.com/SublimeLinter/SublimeLinter.github.io/wiki/Linter-Settings).
32+
33+
`tidy` must be configured via command line arguments. You can use the `"args"` linter setting to pass arguments to tidy.
34+
35+
## Contributing
36+
If you would like to contribute enhancements or fixes, please do the following:
37+
38+
1. Fork the plugin repository.
39+
1. Hack on a separate topic branch created from the latest `master`.
40+
1. Commit and push the topic branch.
41+
1. Make a pull request.
42+
1. Be patient. ;-)
43+
44+
Please note that modications should follow these coding guidelines:
45+
46+
- Indent is 4 spaces.
47+
- Code should pass flake8 and pep257 linters.
48+
- Vertical whitespace helps readability, don’t be afraid to use it.
49+
50+
Thank you for helping out!

linter.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# linter.py
3+
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
4+
#
5+
# Written by Aparajita Fishman
6+
# Copyright (c) 2013 Aparajita Fishman
7+
#
8+
# License: MIT
9+
#
10+
11+
"""This module exports the HtmlTidy plugin class."""
12+
13+
from SublimeLinter.lint import Linter, util
14+
15+
16+
class HtmlTidy(Linter):
17+
18+
"""Provides an interface to tidy."""
19+
20+
syntax = 'html'
21+
cmd = 'tidy -errors -quiet -utf8'
22+
regex = r'^line (?P<line>\d+) column (?P<col>\d+) - (?:(?P<error>Error)|(?P<warning>Warning)): (?P<message>.+)'
23+
line_col_base = (1, 1)
24+
error_stream = util.STREAM_STDERR

messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"install": "messages/install.txt"
3+
}

messages/install.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SublimeLinter-html-tidy
2+
-------------------------------
3+
4+
This linter plugin for SublimeLinter provides an interface to tidy.
5+
6+
For more information, please see https://github.com/Aparajita/SublimeLinter-html-tidy.

0 commit comments

Comments
 (0)