Preparation of porous diatomite-templated carbons with large adsorption capacity and mesoporous zeolite K-H as a byproduct.