Investigating polymers as precursors for the synthesis of covalent and dynamic (nano)materials for sensing applications