Pretty XML in the Smultron Editor

This is a function I often use to help me read XML from various systems. It’s not in the default package of Tools in Smultron so you have to create it yourself.

1. First open the Commands Window (Tools->Handle Commands->Show Command Window)

2. Create a new command and give it a name (Create Command button)

3. Paste the following code in the lower pane of the window:

#!/bin/bash
cat %%s | /usr/bin/tidy -indent -quiet -xml -wrap 100

4. Tick the ‘Inline’ option

5. Close the Command Window

Now you can open or paste a one row xml document into the editor, select the XML, copy it to clipboard and then run the command (Tool->Command->YourCommand) and voila! The XML is now in pretty format!

This works at least in Smultron version 3.6b1 which is the version I use

  1. Hitta så många bra lathundar!
    Tackar!

    MvH
    J

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.