Synthesis and charactrization of the materials. Four CTFs were synthesized via condensation of aromatic diamidine bromides and aromatic dialdehydes. The series of periodic co-polymers with the desired quantity and positioning of dopant in the material were adjusted by the stoichiometric ratio of di-amidine and di-aldehyde in a 2:1 ratio for in situ polycondensation of the triazine linkage (Figure ). This polycondensation approach, recently reported by Cooper, Tan and co-workers, provides superior control compared with the wellestablished ionothermal CTF synthesis, paving the way to master the desired building block sequence in the bipyridine-containing CTFs family, by applying the principle of orthogonal chemistry. However, so far, only few CTFs obtained by polycondensation are reported, mostly limited to functionalized aromatic aldehydes and non-functionalised terephthalamidine or [1,1'-biphenyl]-4,4'-bis(carboximidamide). Here, we employed bipyridine and biphenyl aromatic cores as n-doping and non-doping moieties, respectively (Figure ). Since the aromatic dialdehydes are commercially available, the synthesis of CTFs started with preparing 5,5'-diamidine-2,2'-bipyridine dihalide and 4,4'-biphenyldiamidine dihalide, adapting the previously established procedure. As the synthesis of the amidine chloride produces a large excess of NH 4 Cl, its purification is a crucial step. While non-functionalised terephthalamidine dichloride could be obtained in good purity following the procedure established by Shu et al., all attempts to obtain sufficiently pure 5,5'-diamidine-2,2'-bipyridine by washing or recrystallisation from ethanol/acetone mixtures were unsucessful. Thus, we applied a counter ion exchange strategy to transfer the amidine first into the tetraphenylborate, which is soluble in acetone, and then into the corresponding bromide (for details see SI, section 2.1). Note that using terephthalamidine dibromide in the synthesis of CTF-1 did not affect porosity, band-gap or crystallinity with respect to the synthesis procedure described by Cooper and co-workers applying terephthalamidine dichloride (see SI section 3). Since two molecules of amidine bromide and one of aldehyde are needed for the synthesis of a triazine core, a series of materials containing 0, 33, 66 and 100% of bipyridine building units was synthesized (Figure ). The materials were named CTF-02, CTF-02-Bpy 0.33 , CTF-02-Bpy 0.66 and CTF-02-Bpy, following the increase in bipyridine content within the CTF structure.