Can anyone point me to instructions on how to modify HTML Tidy's formatting of documents. There's a bunch of stuff that happens that I don't care for...stuff that running HTML Tidy in BBEdit doesn't do. I'd love Dreamweaver's method of formatting within TextMate--at least for HTML files. What's nice about BBEdit is that it allows you to point to Dreamweaver's SourceProfile.txt file as a custom profile for source formatting.
On 9. Nov 2006, at 02:56, hcabbos wrote:
Can anyone point me to instructions on how to modify HTML Tidy's formatting of documents. There's a bunch of stuff that happens that I don't care for...stuff that running HTML Tidy in BBEdit doesn't do. I'd love Dreamweaver's method of formatting within TextMate--at least for HTML files. What's nice about BBEdit is that it allows you to point to Dreamweaver's SourceProfile.txt file as a custom profile for source formatting.
Select Bundles → Bundle Editor → Show Bundle Editor. Then unfold HTML and locate the Tidy command.
Currently these are the options used:
"${TM_TIDY:-tidy}" -f /dev/null -iq -utf8 \ -wrap 0 --tab-size $TM_TAB_SIZE --indent-spaces $TM_TAB_SIZE \ ${TM_SELECTED_TEXT:+--show-body-only yes} \ ${TM_XHTML:+-asxhtml} \ --doctype strict \ --enclose-text yes \ --tidy-mark no
We have debated a little about doing a dialog for the options (via tm_dialog) but I think none of us (who debated this) use tidy, and most of us think we should just ensure it has good defaults.
Please let us know which options you think should be changed.
hcabbos wrote:
Can anyone point me to instructions on how to modify HTML Tidy's formatting of documents. There's a bunch of stuff that happens that I don't care for...stuff that running HTML Tidy in BBEdit doesn't do.
You'll have to clarify. What exactly happens that you don't like? How would you prefer the command to work? Which options from tidy (there are several dozen, almost all of which seem pretty stupid to me :p) do you want TextMate to expose to the user?
For more on creating TM commands, the TM manual has a pretty good explanation.
I'd love Dreamweaver's method of formatting within TextMate--at least for HTML files. What's nice about BBEdit is that it allows you to point to Dreamweaver's SourceProfile.txt file as a custom profile for source formatting.
You could certainly build this feature yourself. But if you want someone else to help you out with that, you'll have to explain how it works.
* * *
I think it would maybe be worthwhile to put some sort of GUI dialog in front of a tidy command. But which options are needed? Keeping the interface as super simple as possible also has many benefits (such as keeping people from making unreadable unindented html ;).