Sometime it is helpful to show source code on the website or blog. One way to do
it is to write your code in rst or markdown format, and then convert the rst
or markdown document to html. Another way is to use online source code to html
coverter. Google search "source code to html". I found is the best
online converter:
Demo (with line numbers):
1
2
3
4
5
6
7 | #include <stdio.h>
int main() {
printf("hello world\n");
return 0;
}
|
Demo (without line numbers):
#include <stdio.h>
int main() {
printf("hello world\n");
return 0;
}
References:
More silimar online converters: