I'm probably getting this completely wrong, but what I assumed this was doing was converting a nested directory of documents into a JSON structure. However the JSON structure doesn't fit this way of thinking as it portrays documents as direct children of documents.
Therefore I don't understand how your plugin is determining which document becomes the parent of and sub-documents. Is there a "parent" config i can specify on a per document level?