add class hierarchy for document links