Domanda

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.

È stato utile?

Soluzione

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>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top