Has this been brought up as a feature request? skEdit's (i'm using it while I wait for my Paypal deposit) tidy functionality is very well thought out. I'd like to see something similar in TM.
Here is my current kludge to get two HTML Tidy commands: one replaces a window with its Tidy-ed version, and another just produces a window with clickable error output. Note that (bug? feature?) if HTML Tidy thinks there are errors in your document and you do a 'replace' then it will place the errors at the top of the document. You can fiddle with the Tidy flags to avoid that.
Also note that my version only runs on the last saved version and not the current one. That can also be tweaked...
Anyway, get HTML Tidy from http://tidy.sourceforge.net/ then install it someplace convenient. I put the command-line version at ~/bin/tidy
Report Errors Command:
Before: nothing Command: ~/bin/tidy -e "$TM_FILEPATH" Stdin: None Stout: Sep window Pattern: line (\d+) column (\d+) - (.*?)$ Format: $3 Line: 1
Replace Document with Tidy-ed Version Command:
Before: nothing Command: ~/bin/tidy -bicq "$TM_FILEPATH" Stdin: None Stout: Replace doc Pattern: Format: Line:
Works great for me!
- Eric
Thanks Eric. I'll see if I can get this working for me. I may have some ?s about how to tweak output.
-t On Dec 2, 2004, at 5:28 AM, Eric Hsu wrote:
Has this been brought up as a feature request? skEdit's (i'm using it while I wait for my Paypal deposit) tidy functionality is very well thought out. I'd like to see something similar in TM.
Here is my current kludge to get two HTML Tidy commands: one replaces a window with its Tidy-ed version, and another just produces a window with clickable error output. Note that (bug? feature?) if HTML Tidy thinks there are errors in your document and you do a 'replace' then it will place the errors at the top of the document. You can fiddle with the Tidy flags to avoid that.
Also note that my version only runs on the last saved version and not the current one. That can also be tweaked...
Anyway, get HTML Tidy from http://tidy.sourceforge.net/ then install it someplace convenient. I put the command-line version at ~/bin/tidy
Report Errors Command:
Before: nothing Command: ~/bin/tidy -e "$TM_FILEPATH" Stdin: None Stout: Sep window Pattern: line (\d+) column (\d+) - (.*?)$ Format: $3 Line: 1
Replace Document with Tidy-ed Version Command:
Before: nothing Command: ~/bin/tidy -bicq "$TM_FILEPATH" Stdin: None Stout: Replace doc Pattern: Format: Line:
Works great for me!
- Eric
-- Eric Hsu, Assistant Professor of Mathematics San Francisco State University erichsu@math.sfsu.edu http://math.sfsu.edu/hsu _______________________________________________ textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/mailman/listinfo/textmate
I saw this skEdit feature and was honestly confused because I couldn't see how it could be useful except for the very simplest case where you are editing a complete HTML document. I work on complex PHP-based web sites composed of thousands of files with bits of HTML generated by different files, so an in-editor HTML validation wouldn't be useful. Instead we've programmed an in-browser HTML validation where the Tidy output is added to the bottom of the PHP-generated HTML page, and this seems to work pretty well for us.
On Dec 2, 2004, at 5:28 AM, Eric Hsu wrote:
Has this been brought up as a feature request? skEdit's (i'm using it while I wait for my Paypal deposit) tidy functionality is very well thought out. I'd like to see something similar in TM.