A gaseous hydrogen chloride chemosensor based on a 2D covalent organic framework.