COF engineering with a built-in, high concentration of defined N-doped sites overcomes the "black-box" drawback of conventional trial-and-error N-doping methods (used in polymeric carbon nitride and graphene), that hamper a directed evolution of functional carbon interfaces based on structure-reactivity guidelines. The cutting-edge challenge is to dissect the many complex and interdependent functions that originate from reticular N-doping, including modification of the material optoelectronics, band alignments, interfacial contacts and co-localization of active-sites, producing a multiple-set of effectors that can all play a role to regulate photocatalysis. Herein, an ON-OFF gated photocatalytic H