Generate the category list from the code and the database.