tsekityam / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

Easier install over CDN #251

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
At the moment, installing this awesome functionality on an HTML page involves:

* include CSS file
* include prettify.js
* include other language JSs
* call `prettyPrint()` when page is loaded

I'd like to request a single URL like the following

http://cdn_server_or_googlecode_svn/prettify.js?lang=hs,scheme&autoload=true

which means that only a single line need be inserted in the HTML.

This issue compliments issue 224 in setting up a really easy to use Markdown 
and Google Code Prettify system.

Original issue reported on code.google.com by Sam.Hall...@gmail.com on 21 Oct 2012 at 9:52

GoogleCodeExporter commented 9 years ago
Would this URL be included via a <script> element :

   <script src="http://cdn_server_or_googlecode_svn/prettify.js?lang=hs,scheme&autoload=true"></script>

?

What does autoload mean?  Does that control setting up on onload handlers?

Original comment by mikesamuel@gmail.com on 4 Feb 2013 at 10:25

GoogleCodeExporter commented 9 years ago
Have a look and see how MathJax do things – if you could replicate their CDN 
install / inclusion that would be great.

Original comment by Sam.Hall...@gmail.com on 4 Feb 2013 at 10:29

GoogleCodeExporter commented 9 years ago
Thanks.  I found 
http://docs.mathjax.org/en/v1.1-latest/configuration.html#loading and 
http://docs.mathjax.org/en/v1.1-latest/options/hub.html but there doesn't seem 
to be any autoload option.  What did you intend autoload to mean?

Original comment by mikesamuel@gmail.com on 7 Feb 2013 at 10:40

GoogleCodeExporter commented 9 years ago
Autoload in the sense of: include a script file and that is it. No need to 
write any further Javascript hooks.

Original comment by Sam.Hall...@gmail.com on 7 Feb 2013 at 10:43

GoogleCodeExporter commented 9 years ago
(As opposed to the multi-line, multi-context, installation that is currently 
needed – even if using a public version of the prettify.js script)

Original comment by Sam.Hall...@gmail.com on 7 Feb 2013 at 10:45

GoogleCodeExporter commented 9 years ago
Ok, so ?autoload=true is only used because that URL is serving a dual purpose 
as a loader and as one of the loaded components, and is not derived from 
anything in mathjax's cdn.

Original comment by mikesamuel@gmail.com on 7 Feb 2013 at 11:00

GoogleCodeExporter commented 9 years ago
https://google-code-prettify.googlecode.com/svn/loader/ now has a 
run_prettify.js script which can be used thus:

  <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>

It's rough and still needs quite a bit of testing, but the interface is ready 
for criticism.
Docs at top of 
http://code.google.com/p/google-code-prettify/source/browse/trunk/js-modules/run
_prettify.js

Original comment by mikesamuel@gmail.com on 11 Feb 2013 at 1:44

GoogleCodeExporter commented 9 years ago
Cool, looks good. I'm not able to use it until #224 is addressed - I need to 
specify the code language by running a hacky script so auto-loading is not 
possible.

Original comment by Sam.Hall...@gmail.com on 21 Feb 2013 at 6:59

GoogleCodeExporter commented 9 years ago

Original comment by mikesamuel@gmail.com on 25 Feb 2013 at 5:00