Formats the code and adds a new menu entry.