Description
Add a level macro that derives its level property from its location in the document tree.
The level macro traverses the document (it is part of) to the root of documents and looks for a parent document of the same doctype and a Level property. It then adds to this property one and assumes that as its level.
The macro is useful for software documentation where you drill into components and want to calculate the level of the component based on the level of the document in the hierarchy.