The Scottish government has revealed details of a plan to cut childhood obesity rates, with a key component restricting the promotion of unhealthy foods and drinks.