A succinct strategy for construction of nanoporous ionic organic networks from a pyrylium intermediate.