Islamic texts can be classified in different ways. One way is by level of commentary:
The matn (plural: mutun) – this is the text that is being commented on. Usually these texts are meant to be summarized and concise in nature.
The sharh (plural: shuruh)- the commentary on a matn and these typically fall into one of the following types;
1) Shuruh that are meant to clarify the phrases of the author. These type of texts will focus on explaining the grammar of the text as well as defining terms.
2) Shuruh that are meant to conceptualize the issues of the text. These texts go into details on the rulings placed in the text. They will go into details with examples and sometimes exceptions/conditions. Some texts at this level combine this level and the one above in one text.
3) Shuruh that are meant to be at an advanced level often times bringing debates and different opinions on the matters discussed in the matn while discussing evidences and sources of the statements as well.
The hashiya (plural: hawashi)- The commentaries that are written on the commentaries, translated as super commentary or gloss or marginalia. These type of texts will typically either be supportive of the sharh adding more detail and expanding upon what has been done. Or it will be a critical hashiya focusing on fixing what the author believes to be mistakes of the author or a combination of these two.*
The taqreer (plural: taqreeraat) – The commentary on the hashiya, usualy these texts are very minor notes added onto the hashiya and are not meant to be comments on every part of the book.
*Note that hashiya has two usages as well. The first one is what was mentioned above and the second one which was used earlier in history which refers to a sharh which does not intend to comment on every part of the text. This is why Hattab’s commentary on Khalil for example is referred to as a hashiya sometimes.