A nanoporous two-dimensional polymer by single-crystal-to-single-crystal photopolymerization.