3

The google prettify is working great for me. I have built an application with a Twitter bootstrap front-end and the google prettify syntax highlighting. But the application is also used for working offline e.g. localhost, so I included the prettify.js and prettify.css.

Now when I go offline and work in the application, it will start looking for online code through the local prettify.js version:

  • https://google-code-prettify.googlecode.com/svn/loader/lang-"+encodeURIComponent(D[m])+".js

  • https://google-code-prettify.googlecode.com/svn/loader/skins/"+encodeURIComponent(N[m])+".css

  • https://google-code-prettify.googlecode.com/svn/loader/prettify.css

It is working fine offline, but why is it requesting the external js and css files and how can I remove this from the minified prettify.js? I don't need it and it is slowing down the application.

Theo
  • 150
  • 11
  • What does your HTML look like? Specifically, what ` – Mike Samuel Sep 24 '13 at 15:57
  • Hi Mike, I need to work offline, but in the prettify.js file it is calling externally: `e.src="https://google-code-prettify.googlecode.com/svn/loader/lang-"+encodeURIComponent(D[m])+".js";` See the Google project here: https://code.google.com/p/google-code-prettify/ – Theo Sep 25 '13 at 09:42

1 Answers1

2

The GettingStarted wiki page explains:

Serving your own JS & CSS

You can download the scripts and styles and serve them yourself. Make sure to include both the script and a stylesheet:

<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>
Mike Samuel
  • 118,113
  • 30
  • 216
  • 245
  • That is what I am doing Mike, but look inside the prettify.js and you will find that it is requesting more files from googlecode. I would like to know how I can use all of it and still keep it working. – Theo Oct 01 '13 at 10:19
  • 1
    @Theo, If you load `prettify.js` instead of `runprettify.js` then it won't load those other files. Are you sure you didn't save `runprettify.js` as `prettify.js` by mistake? – Mike Samuel Oct 01 '13 at 15:29