Skip to main content
Tweeted twitter.com/#!/StackCodeReview/status/541071353341034496
Rollback to Revision 4
Source Link
200_success
  • 145.7k
  • 22
  • 191
  • 481

Edit

Thank you for your suggestions. I have updated the code to reflect most suggestions I got. The latest code (at the time of writing).

The messy main method now looks like this:

/* Main logic */
read_markdown(ib, number_of_sources, file, in);
render_markdown(ib, ob);
write_html_to_tmp_file(tmp_html_file_path, tmp_html_file_protocol_path, ob, verbose, stylesheet_file_path);
generate_pdf(tmp_html_file_protocol_path, output_pdf_file_path);

/* Cleanup */
unlink(tmp_html_file_path);
return EXIT_SUCCESS;

I would say it's a great improvement.

Edit

Thank you for your suggestions. I have updated the code to reflect most suggestions I got. The latest code (at the time of writing).

The messy main method now looks like this:

/* Main logic */
read_markdown(ib, number_of_sources, file, in);
render_markdown(ib, ob);
write_html_to_tmp_file(tmp_html_file_path, tmp_html_file_protocol_path, ob, verbose, stylesheet_file_path);
generate_pdf(tmp_html_file_protocol_path, output_pdf_file_path);

/* Cleanup */
unlink(tmp_html_file_path);
return EXIT_SUCCESS;

I would say it's a great improvement.

Add information about the solution
Source Link

Edit

Thank you for your suggestions. I have updated the code to reflect most suggestions I got. The latest code (at the time of writing).

The messy main method now looks like this:

/* Main logic */
read_markdown(ib, number_of_sources, file, in);
render_markdown(ib, ob);
write_html_to_tmp_file(tmp_html_file_path, tmp_html_file_protocol_path, ob, verbose, stylesheet_file_path);
generate_pdf(tmp_html_file_protocol_path, output_pdf_file_path);

/* Cleanup */
unlink(tmp_html_file_path);
return EXIT_SUCCESS;

I would say it's a great improvement.

Edit

Thank you for your suggestions. I have updated the code to reflect most suggestions I got. The latest code (at the time of writing).

The messy main method now looks like this:

/* Main logic */
read_markdown(ib, number_of_sources, file, in);
render_markdown(ib, ob);
write_html_to_tmp_file(tmp_html_file_path, tmp_html_file_protocol_path, ob, verbose, stylesheet_file_path);
generate_pdf(tmp_html_file_protocol_path, output_pdf_file_path);

/* Cleanup */
unlink(tmp_html_file_path);
return EXIT_SUCCESS;

I would say it's a great improvement.

edited tags
Link
syb0rg
  • 21.9k
  • 10
  • 113
  • 193
deleted 122 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
Loading
Added code to the post, instead of just linking to it.
Source Link
Loading
Source Link
Loading