At 09:18 -0400 03/28/2012, TJ Luoma wrote:
>On Wed, Mar 28, 2012 at 5:21 AM, Rick Gordon <[email protected]> wrote:
>> So how can I -- on an entire project -- get the result of Tidy > Cleanup
>>Document without the entity conversion -- or else, how can I reconvert
>>the entities to their numeric form.
>
>My first thought is that you might pipe the project to /usr/bin/tidy
>directly rather than using BBEdit's built-in.
>
>I don't know if BBEdit's tidy will respect the HTML_TIDY environmental
>setting, but that might be worth looking into as well.


Although BBEdit's built-in Tidy commands do not look at the environment,
you can make use of any options supported by the command-line 'tidy' tool
(see 'man tidy') by applying it as a text filter.

To do this:

1. Create a tidy config file (e.g. "~/Documents/tidyconfig.txt") which
   contains whatever options you wish to apply.

2. Create a shell filter which invokes 'tidy'[1] as follows:

    ====
    #!/bin/sh
    /usr/bin/tidy -f /dev/null -config /path/to/your/tidyconfig.txt
    ====

    substituting the actual path to your tidy config file for the
    placeholder.

3.  Save this filter as a file (e.g. "tidy_it.sh") in the "Text Filters"
    folder of BBEdit's app support folder (~/Library/Application
    Support/BBEdit/Text Filters/)

You can now apply this filter to the frontmost document by choosing Text ->
Apply Text Filter -> [tidy_it]


[1. Please note that whatever options you set for 'tidy', you'll need to
redirect error output away from stderr, otherwise the combined output will
be directed to BBEdit's Unix Script Output window instead of replacing the
current document's contents.]


Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc.                      <http://www.barebones.com>
P.O. Box 1048, Bedford, MA 01730-1048

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to