Sodium hydroxide was first prepared by soap makers. A procedure for making sodium hydroxide appeared as part of a recipe for making soap in an Arab book of the late 13th century:  (Inventions from the Various Industrial Arts), which was compiled by al-Muzaffar Yusuf ibn Umar ibn Ali ibn Rasul (d. 1295), a king of Yemen. The recipe called for passing water repeatedly through a mixture of alkali (Arabic: , where  is ash from saltwort plants, which are rich in sodium; hence alkali was impure sodium carbonate) and quicklime (calcium oxide, CaO), whereby a solution of sodium hydroxide was obtained. European soap makers also followed this recipe. When in 1791 the French chemist and surgeon Nicolas Leblanc (1742–1806) patented a process for mass-producing sodium carbonate, natural "soda ash" (impure sodium carbonate that was obtained from the ashes of plants that are rich in sodium) was replaced by this artificial version. However, by the 20th century, the electrolysis of sodium chloride had become the primary method for producing sodium hydroxide.