The context tracking annotation may be used to track arbitrary contextual information about your document. The Migrate conversion does not use this annotation, but you can set context and then test it from other rules to help get annotations applied correctly.
The depth argument allows more than one piece (i.e. label) of context to be tracked for a given class. It is optional on clear-context. If no depth is specified, the entire context is cleared. But, if a depth is a specied, only the labels specified at a greater depth are removed.
For example, you might simply want to keep track of the current topic type, as this may affect the logic of your rules. For this, you can:
By setting the depth, the context tracker will remember the outermost topic types when an inner topic type is started. When a new topic begins, clear the context, but only to the depth of the new topic. This will clear the tracking of the context for inner topics that are not complete. You can now also set a new tracking entry for the topic that is just beginning.