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

Comments are closed.

Niklas Tech Blog
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.