Covalent organic frameworks (COFs) are a class of crystalline porous materials in which organic building blocks are assembled with atomic precision to construct predetermined skeletons and nanopores.