I am using blogger.com to host some texts on programming, and Let me use prettify (just like stackoverflow) to nicely colour the code samples.
How do you install the prettify scripts in to the blog domain?
Will it be better (if indeed its likely) to connect to a shared copy somewhere?
I've webspace on the different domain. Would which help?
Whenever you create a new entry in blogger, you receive the choice to make use of HTML inside your entry and also to edit your site records.
so type http://blogger.com , then login, then Posting>Edit Posts>Edit then inside put this at the very top:
within this situation because blogger doesn't let us connect to the stylesheet, we simply embed the prettify.css contents.
<code></code> tag or perhaps a
<pre></pre> tag using the class title of
"prettyprint", you may also specify the word what such as this
therefore it look such as this
<pre class="prettyprint lang-html"> <!-- your code here--> </pre>
or such as this
<code class="prettyprint lang-html"> <!-- your code here--> </code>
the code that you devote will need its HTML washed from < and > to get this done just paste your code in here: http://world wide web.simplebits.com/cgi-bin/simplecode.pl
you are able to place the top code inside your HTML layout to ensure that its incorporated for those pages automatically if you want.
as well as your done :)
The next labored for me personally immediately.
- Visit Blogger-->Layout-->Edit HTML
- Copy the next snippet and paste it soon after "
<head>" within the "Edit template" area:
<link href='http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css' rel='stylesheet' type='text/css'/>
- After "
</mind>" replace "
<body>" with "
- Click "SAVE TEMPLATE"
- Visit Blogger-->Posting-->New Publish. Make certain you are editing the HTML by hitting "Edit HTML". Within the empty area try:
<pre class="prettyprint">int foo=
- Notice should you click "Preview" now you will see this code in black only. Don't be concerned (yet).
- Click "PUBLISH Publish" after which "VIEW BLOG". Your code ought to be prettified.
Take a look at SyntaxHightlighter at http://alexgorbatchev.com/wiki/SyntaxHighlighter On that website there are also instructions regarding how to utilize it at blogger.com and also the site provides a located version from the needed scripts so you don't have to host files somewhere yourself.