Adds or updates chapter numbers in a markdown file