Monday, March 19, 2012

HowTo: Blogger Syntax Highlight

The following is a way to get code syntax highlighting into your blogger posts.

I've had easier times with Wordpress if I remember correctly but w/e this is for Blogger so who cares.

Sources:
In there search for the </head> tag.
Right above that post the following:





















To actually post code you need to take a block of html like this into your posts "Edit HTML" and paste it like so:



int main( int argc, char** argv ){
printf("Hi there...\n");
return 0;
}





Which will give you this:


int main( int argc, char** argv ){
printf("Hi there...\n");
return 0;
}




Here is the html for this page. The completeness of it may help...



The following is a way to get code syntax highlighting into your blogger posts.

I've had easier times with Wordpress if I remember correctly but w/e this is for Blogger so who cares.

Sources:
In there search for the </head> tag.
Right above that post the following:





















To actually post code you need to take a block of html like this into your posts "Edit HTML" and paste it like so:



int main( int argc, char** argv ){
printf("Hi there...\n");
return 0;
}





Which will give you this:


int main( int argc, char** argv ){
printf("Hi there...\n");
return 0;
}





No comments:

Post a Comment