turn comments into proper doc elements