Tidy

122 views
Skip to first unread message

Calion

unread,
Feb 11, 2018, 10:42:47 AM2/11/18
to BBEdit Talk
I miss the old BBTidy/the BBEdit Tidy command. Tidy exists on the macOS command line. Surely there's some way to combine this terminal command with BBEdit? Somehow?

@lbutlr

unread,
Feb 11, 2018, 12:27:58 PM2/11/18
to BBEdit Talk
On 2018-02-11 (08:39 MST), Calion <calo...@gmail.com> wrote:
>
> I miss the old BBTidy/the BBEdit Tidy command. Tidy exists on the macOS command line. Surely there's some way to combine this terminal command with BBEdit? Somehow?


tidy index.html | bbedit


--
"...and that's not incense"

Greg Raven

unread,
Feb 12, 2018, 7:05:52 AM2/12/18
to BBEdit Talk
The version of Tidy that comes with High Sierra dates back to 2006. If I understand it, this version does not work with HTML5.

You can get the latest version -- 5.6.0 -- various ways (such as Homebrew). Details here:


I haven't tried this because I prefer BBEdit's built-in tools, but you could probably (after installing the latest version of tidy) create a bash text filter.

Greg Raven

unread,
Feb 12, 2018, 7:39:59 AM2/12/18
to BBEdit Talk
I just installed the HTML5 Tidy binary from the website, and created a text filter thusly:

#!/bin/bash
tidy -clean -indent -utf8

Invoking this against the current front-most document runs Tidy on your HTML, replaces the existing HTML with the Tidy version, and generates a page listing errors and information. Haven't figured out how to suppress the errors and information page without defining a separate config file, but if that's important to do you can experiment.

On Sunday, February 11, 2018 at 7:42:47 AM UTC-8, Calion wrote:

Kerri Hicks

unread,
Feb 12, 2018, 9:46:15 AM2/12/18
to bbe...@googlegroups.com
Which features of Tidy did you find the most helpful? There are quite a few native features in BBEdit that replicate some of the functionality of Tidy. I used to use Tidy religiously, but have found that the baked-in BBEdit features do most of what I need.

--Kerri

On Sun, Feb 11, 2018 at 10:39 AM, Calion <calo...@gmail.com> wrote:
I miss the old BBTidy/the BBEdit Tidy command. Tidy exists on the macOS command line. Surely there's some way to combine this terminal command with BBEdit? Somehow?

--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"sup...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+unsubscribe@googlegroups.com.
To post to this group, send email to bbe...@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

ctfishman

unread,
Feb 12, 2018, 9:51:48 AM2/12/18
to BBEdit Talk
#!/bin/sh
tidy

Save the two lines above as "Tidy.sh" in your text filters folder (most likely /Users/<username>/Library/Application Support/BBEdit/Text Filters/). Then under the menu Text -> Apply Text Filter you'll see an option for "Tidy". You can even assign it a keystroke if you want.
Message has been deleted

Robert

unread,
Feb 12, 2018, 1:08:36 PM2/12/18
to BBEdit Talk
I think is you pass "-show-errors 0" it turns off error reporting.

http://tidy.sourceforge.net/docs/quickref.html#show-errors

Greg Raven

unread,
Feb 12, 2018, 1:12:00 PM2/12/18
to BBEdit Talk
That doesn't work for me. That may be something that works in a config file only, not as a command-line switch.

Mark McLeod

unread,
Feb 12, 2018, 1:24:53 PM2/12/18
to bbe...@googlegroups.com
You could try:

#!/bin/bash
tidy -clean -indent -utf8 2>/dev/null

As you see from this page, the 2> should redirect stderr:






--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"sup...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.

Greg Raven

unread,
Feb 12, 2018, 1:28:54 PM2/12/18
to BBEdit Talk
That works. Cock for Dolly!

Tom Robinson

unread,
Feb 12, 2018, 3:09:30 PM2/12/18
to bbe...@googlegroups.com
I use it for making XML documents readable when coding/debugging.

Kerri Hicks

unread,
Feb 13, 2018, 4:50:35 PM2/13/18
to bbe...@googlegroups.com
Would Markup -> Utilities -> Format do what you need?

--Kerri

Tom Robinson

unread,
Feb 13, 2018, 6:22:55 PM2/13/18
to bbe...@googlegroups.com
Looks like it could… will give it a shot next time thanks.

Pretty sure I checked BBEdit’s capabilities for XML tidying, but it would’ve been a while ago.

Cheers

G Alexander

unread,
Feb 14, 2018, 7:49:43 PM2/14/18
to BBEdit Talk
use macports to install tidy

sudo port install tidy


On Sunday, February 11, 2018 at 7:42:47 AM UTC-8, Calion wrote:

@lbutlr

unread,
Feb 15, 2018, 7:17:58 PM2/15/18
to BBEdit Talk
On 2018-02-14 (17:14 MST), G Alexander <artist.imp...@gmail.com> wrote:
>
> use macports to install tidy
>
> sudo port install tidy

There are two reasons I stopped using Macports. One, it requires you to use sudo to install things as root, which is not a great plan. Homebrew is much better about this. Second, Macports requires a *FULL INSTALL* of Xcode, while home-brew requires just the command line utilities (a couple hundred megs versus 5+ GB). Third.. (three! Three reasons!) home-brew self-updates its repository.

$ brew install tidy

--
If you must choose between two evils, pick the one you've never tried
before.

Jean-Christophe Helary

unread,
Feb 15, 2018, 7:56:37 PM2/15/18
to bbe...@googlegroups.com


> On Feb 16, 2018, at 9:17, @lbutlr <kre...@kreme.com> wrote:
>
> --
> If you must choose between two evils, pick the one you've never tried
> before.

Mail got fixed recently ?

Jean-Christophe Helary
-----------------------------------------------
http://mac4translators.blogspot.com @brandelune


Reply all
Reply to author
Forward
0 new messages