Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Remove RawGit dependency (jsDelivr+GitHack) #573

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

## 29 March 2007

* Added [tests](https://rawgit.com/google/code-prettify/master/tests/prettify_test.html#PHP)
* Added [tests](https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html#php)
for PHP support to address issue [#3](https://github.com/google/code-prettify/issues/3).
* Fixed bug [#6](https://github.com/google/code-prettify/issues/6): `prettyPrintOne`
was not halting. This was not reachable through the normal entry point.
* Fixed bug [#4](https://github.com/google/code-prettify/issues/4): recursing into a
script block or PHP tag that was not properly closed would not silently drop the content.
([test](https://rawgit.com/google/code-prettify/master/tests/prettify_test.html#issue4))
([test](https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html#js_script))
* Fixed bug [#8](https://github.com/google/code-prettify/issues/8): was eating tabs
([test](https://rawgit.com/google/code-prettify/master/tests/prettify_test.html#issue8))
([test](https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html#issue8))
* Fixed entity handling so that the caveat

> Caveats: please properly escape less-thans. `x&lt;y` instead of `x<y`,
Expand Down Expand Up @@ -51,7 +51,7 @@
* Support for `nocode` spans to allow embedding of line numbers and code
annotations which should not be styled or otherwise affect the tokenization
of prettified code. See the issue [#22](https://github.com/google/code-prettify/issues/22)
[testcase](https://rawgit.com/google/code-prettify/master/tests/prettify_test.html#issue22).
[testcase](https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html#issue22).

## 6 Jan 2009

Expand Down Expand Up @@ -99,7 +99,7 @@

## 4 March 2011

* Added a [themes gallery](https://rawgit.com/google/code-prettify/master/styles/index.html)
* Added a [themes gallery](https://raw.githack.com/google/code-prettify/master/styles/index.html)
to showcase contributed styles.
* Added support for XQuery courtesy *Patrick Wied*, Nemerle courtesy *Zimin A.V.*,
and Latex support courtesy *Martin S*.
Expand All @@ -126,7 +126,7 @@

* Added a one script autoload&run mechanism and a way to embed hints in
processing instructions/comments. See
[example](https://rawgit.com/google/code-prettify/master/examples/quine.html).
[example](https://raw.githack.com/google/code-prettify/master/examples/quine.html).

## 4 March 2013

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ An embeddable script that makes source-code snippets in HTML prettier.

* Include the script tag below in your document:
```HTML
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
```
* See [Getting Started](docs/getting_started.md) to configure that URL with
options you need.
Expand Down Expand Up @@ -229,10 +229,10 @@ general feedback.
[Apache License 2.0](COPYING)


[1]: https://rawgit.com/google/code-prettify/master/styles/index.html
[2]: https://rawgit.com/google/code-prettify/master/examples/quine.html
[1]: https://raw.githack.com/google/code-prettify/master/styles/index.html
[2]: https://raw.githack.com/google/code-prettify/master/examples/quine.html
[3]: http://dev.w3.org/html5/spec-author-view/the-code-element.html#the-code-element
[4]: https://rawgit.com/google/code-prettify/master/tests/prettify_test.html
[4]: https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html
[5]: http://wordpress.org/support/topic/125038
[6]: https://rawgit.com/google/code-prettify/master/tests/prettify_test.html#issue22
[6]: https://raw.githack.com/google/code-prettify/master/tests/prettify_test.html#issue22
[7]: http://groups.google.com/group/js-code-prettifier
Binary file modified distrib/prettify-small.zip
Binary file not shown.
12 changes: 6 additions & 6 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ code here
</pre>
```

[Larger example](https://rawgit.com/google/code-prettify/master/examples/quine.html)
[Larger example](https://raw.githack.com/google/code-prettify/master/examples/quine.html)

## Auto-Loader

You can load the JavaScript and CSS for prettify via one URL:

```HTML
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
```

This will load the entire system and schedule the prettifier to run on page
Expand All @@ -47,18 +47,18 @@ arguments) to configure the runner.
| --------------------- | ------- | ------------------------------ |
| autorun=(true, false) | true | run automatically on page load |
| lang=... | none | Loads the language handler for the given language which is usually the file extension for source files for that language. See the [index of language handlers](../src). If specified multiple times (`?lang=css&lang=ml`) then all are loaded. |
| skin=... | none | See the [skin gallery](https://cdn.rawgit.com/google/code-prettify/master/styles/index.html). If specified multiple times, the first one to successfully load is used. |
| skin=... | none | See the [skin gallery](https://raw.githack.com/google/code-prettify/master/styles/index.html). If specified multiple times, the first one to successfully load is used. |
| callback=js_ident | | `window.exports["js_ident"]` will be called when prettyprinting finishes. If specified multiple times, all are called. |

For example:

```HTML
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang=css&amp;skin=sunburst"></script>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js?lang=css&amp;skin=sunburst"></script>
```

The above specifies the `lang` parameter to also load the CSS language
extension and the `skin` parameter to load the
[*sunburst*](https://cdn.rawgit.com/google/code-prettify/master/styles/index.html#sunburst)
[*sunburst*](https://raw.githack.com/google/code-prettify/master/styles/index.html#sunburst)
skin.

## Serving your own JS & CSS
Expand Down Expand Up @@ -87,7 +87,7 @@ so you can swap in a different stylesheet to change the way code is
prettified.

The easiest way to create your own stylesheet is by starting with one from the
[style gallery](https://cdn.rawgit.com/google/code-prettify/master/styles/index.html)
[style gallery](https://raw.githack.com/google/code-prettify/master/styles/index.html)
and tweaking it.

You can use CSS `@media` rules to specify styles that work well with printers
Expand Down
4 changes: 2 additions & 2 deletions examples/quine.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Making Quines Prettier</title>
<!-- The defer attribute is not necessary for autoloading, but is necessary
for the script at the bottom to work as a Quine. -->
<script src="https://rawgit.com/google/code-prettify/master/loader/run_prettify.js?autoload=true&amp;skin=sunburst&amp;lang=css" defer></script>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js?autoload=true&amp;skin=sunburst&amp;lang=css" defer></script>
<style type="text/css">
.operative { font-weight: bold; border: 1px solid yellow; }
#quine { border: 4px solid #88c; }
Expand All @@ -26,7 +26,7 @@ <h1>Making Quines Prettier</h1>
The line numbers to the left appear because the preceding comment
<code>&lt;?prettify lang=html linenums=true?&gt;</code> turns on
line-numbering and the
<a href="https://rawgit.com/google/code-prettify/master/styles/index.html">stylesheet</a>
<a href="https://raw.githack.com/google/code-prettify/master/styles/index.html">stylesheet</a>
(see <code>skin=sunburst</code> in the <code>&lt;script src&gt;</code>)
specifies that every fifth line should be numbered.
</p>
Expand Down
6 changes: 3 additions & 3 deletions js-modules/run_prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* +------------------+---------------+------------------------------+--------+
* | skin= | skin name | Loads the skin stylesheet | none. |
* | | | named "<NAME>.css". | |
* | | | https://cdn.rawgit.com/ | |
* | | | https://raw.githack.com/ | |
* | | | google/code-prettify/master/ | |
* | | | styles/index.html | |
* +------------------+---------------+------------------------------+--------+
Expand All @@ -56,7 +56,7 @@
* 2. Loads the sunburst.css stylesheet instead of the default prettify.css
* stylesheet.
* A gallery of stylesheets is available at
* https://cdn.rawgit.com/google/code-prettify/master/styles/index.html
* https://raw.githack.com/google/code-prettify/master/styles/index.html
* 3. Since autorun=false is not specified, calls prettyPrint() on page load.
* </div>
*/
Expand Down Expand Up @@ -180,7 +180,7 @@
// This only works if this script is loaded via https : something
// over which we exercise no control.
var LOADER_BASE_URL =
'https://cdn.rawgit.com/google/code-prettify/master/loader';
'https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader';

for (var i = 0, n = langs.length; i < n; ++i) (function (lang) {
var script = doc.createElement("script");
Expand Down
4 changes: 2 additions & 2 deletions loader/run_prettify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/run_prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* +------------------+---------------+------------------------------+--------+
* | skin= | skin name | Loads the skin stylesheet | none. |
* | | | named "<NAME>.css". | |
* | | | https://cdn.rawgit.com/ | |
* | | | https://raw.githack.com/ | |
* | | | google/code-prettify/master/ | |
* | | | styles/index.html | |
* +------------------+---------------+------------------------------+--------+
Expand All @@ -56,7 +56,7 @@
* 2. Loads the sunburst.css stylesheet instead of the default prettify.css
* stylesheet.
* A gallery of stylesheets is available at
* https://cdn.rawgit.com/google/code-prettify/master/styles/index.html
* https://raw.githack.com/google/code-prettify/master/styles/index.html
* 3. Since autorun=false is not specified, calls prettyPrint() on page load.
* </div>
*/
Expand Down Expand Up @@ -228,7 +228,7 @@ var IN_GLOBAL_SCOPE = false;
// This only works if this script is loaded via https : something
// over which we exercise no control.
var LOADER_BASE_URL =
'https://cdn.rawgit.com/google/code-prettify/master/loader';
'https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader';

for (var i = 0, n = langs.length; i < n; ++i) (function (lang) {
var script = doc.createElement("script");
Expand Down