Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Grow a tree from a sitemap. It's eco-friendly despite the XML garbage!

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Sitemap Treemaker

... 'cause all the clever names are taken, probably.

Build Status

Problem: I've got a basic sitemap.xml. It looks like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns=""


I need to build a tree out of all of these clearly hierarchal links. So, I do this:

    sitemap_tree ='')

tree returns a Tree::TreeNode from the library RubyTree. I can now take that tree and do something useful with it, maybe. Or, I could just print a pretty diagram:

    sitemap_tree ='')

    * root
    |---+ about-someplace
    |    |---> board-of-directors



I'm sure there are other things that will need to happen in this gem. As I use it more, I'm sure it'll get fleshed out. If you've got ideas, send them to me by writing them with a thick black marker on the label on a Dogfish Head 90 Minute IPA and mailing it to me or something. If you're also from Indiana, or one of the other states that Dogfish Head no longer serves... I don't know. Email me, or whatever.

Also, pull requests are welcomed. Prepare for poor response times, though.

Something went wrong with that request. Please try again.