How to embed code in blog ?
:- IF it is helpful for you than dont forgot to Comment.
:- Steps required to do this very easily
Step 1 :- You should have Github account
Step 2 :- Open Gist of Github : https://gist.github.com/
Step 3 :- Write your Code here in Gist
Remember you can give any Gist Description but you have to give a proper name of file and the Extension like (.swift, .java, .c, .c++, etc)
Extension is your programming language extension. Which language you want to embed.
Step 4 :- If you once you checked your code and there is no error in your code than you are good to go. Just Click CREATE PUBLIC GIST
Step 5 :- Copy Embed Code :<script src="https://gist.github.com/toletnetwork/9d768e6eb1b7f76b028139819c6bdc71.js"></script> And Paste in your Blog in html mode.
Just Like I am Pasting just below in HTML Mode
NOTE:- I can understand it is very difficult to paste Script in html mode because there is bunch of codes so you got confused, you have to find a break tag or End of Div tag </div> . once you reached there just PASTE your Scrip code.
Step 6 :- Dont worry if Code and Text is not visible to you in any mode . So, once you publish your blog and it will automatically comes in your blog Because JavaScript is Not supported by this Editor. once your blog will be published than browser support this javascript code and than everything will be visible.
Comments
Post a Comment