I had been through a lot for searching the solution to highlight the source code in my Blogger.
This was also the reason I give up on the use of Blogger.
Then I move to here, which has a fine support of highlighting source code;
Here is the step to follow:
Here is a bash script to help your conversion.
Hope this works for you.
This was also the reason I give up on the use of Blogger.
Then I move to here, which has a fine support of highlighting source code;
Here is the step to follow:
- Open your source code with vi or vim;
- Set the line number :set nu (optional)
- Convert your source code to html file :TOhtml
- Copy and Paste the converted code, which is located between body tags.
- Before publish your post, check your post options. Choose use <br /> tags as the html line breaks, and check the compose settings as show HTML literally.
- Unset the line number :set nonu (optional)
- Update: recently I add -c 'syntax on' which could help MAC user to have their syntax highlighted.
Here is a bash script to help your conversion.
#!/bin/sh
for i in $*
do
vim -c ':set nonu' -c ':syntax on' -c ':TOhtml' -c ':w' -c ':q' -c ':q' $i
done
Hope this works for you.
No comments:
Post a Comment