Ordinances passed by cities of all classes and villages must be posted, published in a legal newspaper in or of general circulation in the respective cities or villages, or published in book, pamphlet, or electronic form, as required by their respective charters or general laws.