generate_doc: Handle empty lines correctly.
Fix lint.
generate_doc: Nicer syntax.