This is a paper of mine which is in a highly unfinished and chaotic state but contains useful and coherent text segments.
UniMath/old_notes_on_type_systems
Voevodsky's notes on type systems. This version contains more material than the one on his website.