Is there a Content Delivery Network (CDN) that hosts Google Code Prettify?

CdnPrettifyTypepad

Cdn Problem Overview


Is there a content delivery network (CDN) that is hosting google-code-prettify?

I am putting together a blog on TypePad and would like to take advantage of a CDN if possible.

Cdn Solutions


Solution 1 - Cdn

Found it!

http://www.cdnjs.com/libraries/prettify

<script src="http://cdnjs.cloudflare.com/ajax/libs/prettify/r298/run_prettify.js" type="text/javascript"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.css" type="text/css">

Update: https://github.com/cdnjs/cdnjs/issues/695 (see bottom of page)

Solution 2 - Cdn

I believe you could use it directly from Google Code though.. ? embeding
http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js

Solution 3 - Cdn

You can use Google Code Prettify directly.

Read their Google Code Prettify Readme or wiki, and they tell you how to use them as the hosting provider.

<script
 src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"
 type="text/javascript"></script>

Then to use the prettyprint powers of Google Code Prettify, add class="prettyprint" to your code blocks, which should be in a pre or a code. Examples below:

<pre class="prettyprint">...</pre>

or

<code class="prettyprint">...</code>

Solution 4 - Cdn

There is a CDN for prettify:

https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js

Its use is explained on the official code-prettify repository. You can use it with a skin, like this:

<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js?skin=desert"></script>

That way you don't have to worry about additional CSS files. For more details and a full list of URL configurations, check the Getting Started section.


As mentioned by Jan Šotola, the previous RawGit CDN was shut down.
Read more details on migrating away from deprecated RawGit.

Solution 5 - Cdn

You could create an account on Dropbox and put all the JavaScript and CSS files in the public folder. This worked for me!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionahsteeleView Question on Stackoverflow
Solution 1 - CdnRajishView Answer on Stackoverflow
Solution 2 - CdntXKView Answer on Stackoverflow
Solution 3 - CdnPeter DietzView Answer on Stackoverflow
Solution 4 - Cdnm.spyratosView Answer on Stackoverflow
Solution 5 - CdnBernhard HeijstekView Answer on Stackoverflow