At times you may want to add code in blogspot(http://www.blogger.com). It can be done with the following steps
PS:
There are many other similar services.
Google "Syntax highlighting in Blogspot" to get an entire list
Steps
- Visit code highlighter : http://ajblk.github.io/SyntaxHighlightGenerator-v3.0/OnlineGenerator.html
![Syntax highlighting in Blogspot](http://www.outsource-online.net/blog/wp-content/uploads/2021/12/Step1-generateCode.png)
- Paste the code, select "language" & "code"
- Click "Get Formatted HTML"
- Preview Code
- Add External CSS and JS Library on the begining of the blog
<script src="http://ajblk.github.io/SyntaxHighlightGenerator-v3.0/scripts/sh-v3.0-min.js" type="text/javascript"></script> <link href="http://ajblk.github.io/SyntaxHighlightGenerator-v3.0/styles/shCoreDefault.css" rel="stylesheet" type="text/css">
- Add script at the end of blog
<script type="text/javascript">SyntaxHighlighter.initialize();</script>
- Copy generated code in step 3 and paste in blog
|
|