Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into gh-pages

  • Loading branch information...
commit fa2fdfeab3013bbccc6cf9a3d248c90522cdfb9e 2 parents c9dbc37 + af0c1b6
@mnewt authored
Showing with 38 additions and 53 deletions.
  1. +4 −8 README.md
  2. +0 −5 _config.yml
  3. +14 −22 demo.html
  4. +20 −17 index.html
  5. +0 −1  params.json
View
12 README.md
@@ -12,16 +12,12 @@ The end of your html template should look like this:
```html
<!-- ======================= Begin Prettify ============================-->
<link rel="stylesheet" type="text/css" rel="stylesheet"
-<<<<<<< HEAD
- href="http://mnewt.github.com/prettify-wrapper/prettify.css">
-=======
- href="http://mnewt.github.com/prettify-wrapper/tomorrow-mnewt.css">
->>>>>>> gh-pages
+ href="http://mnewt.github.com/prettify-wrapper/themes/prettify.css">
<script type="text/javascript"
- src="https://raw.github.com/mnewt/prettify-wrapper/master/google-code-prettify/src/prettify.js">
- </script>
- <script type="text/javascript" src="https://raw.github.com/mnewt/prettify-wrapper/master/styleCode.js">
+ src="http://mnewt.github.com/prettify-wrapper/google-code-prettify/src/prettify.js">
</script>
+ <script type="text/javascript"
+ src="http://mnewt.github.com/prettify-wrapper/styleCode.js"></script>
<!-- ======================== End Prettify =============================-->
</body>
</html>
View
5 _config.yml
@@ -1,5 +0,0 @@
-safe: true
-source: source
-destination: pages
-lsi: false
-pygments: false
View
36 demo.html
@@ -6,19 +6,14 @@
<pre>
<code>
-function addClass( classname, element ) {
- var cn = element.className;
- //test for existance
- if( cn == "undefined" ) {
- return;
- }
- //add a space if the element already has class
- if( cn != '' ) {
- classname = ' ' + classname;
- }
- element.className = cn + classname;
+function hasClass(el, name) {
+ return new RegExp('(\\s|^)'+name+'(\\s|$)').test(el.className);
}
+function addClass(el, name)
+{
+ if (!hasClass(el, name)) { el.className += (el.className ? ' ' : '') +name; }
+}
function styleCode()
{
@@ -27,31 +22,28 @@
return;
}
var a = false;
- // iterate through all "pre" tags and add "prettyprint" class
var matches = document.body.getElementsByTagName("pre");
for (var i = 0; i < matches.length; ++i)
{
- addClass("prettyprint", matches[i]);
+ addClass(matches[i], "prettyprint");
a = true;
}
if (a) { prettyPrint() }
}
-
window.onload = function() { styleCode(); };
-
</code>
</pre>
<!-- ======================= Begin Prettify ============================-->
- <link href="http://raw.github.com/mnewt/prettify-wrapper/master/google-code-prettify-min/prettify.css"
- type="text/css" rel="stylesheet"/>
- <script
- src="http://raw.github.com/mnewt/prettify-wrapper/master/google-code-prettify-min/prettify.js"
- type="text/javascript"></script>
- <script src="https://raw.github.com/mnewt/prettify-wrapper/master/styleCode.js"
- type="text/javascript"></script>
+ <link rel="stylesheet" type="text/css" rel="stylesheet"
+ href="http://mnewt.github.com/prettify-wrapper/themes/prettify.css">
+ <script type="text/javascript"
+ src="http://mnewt.github.com/prettify-wrapper/google-code-prettify/src/prettify.js">
+ </script>
+ <script type="text/javascript"
+ src="http://mnewt.github.com/prettify-wrapper/styleCode.js"></script>
<!-- ======================== End Prettify =============================-->
</body>
View
37 index.html
@@ -21,10 +21,6 @@
<h1 id="project_title">Prettify-wrapper</h1>
<h2 id="project_tagline">Wraps Google Prettify into a nice little bow for easy inclusion into any website or blog</h2>
- <section id="downloads">
- <a class="zip_download_link" href="https://github.com/mnewt/prettify-wrapper/zipball/master">Download this project as a .zip file</a>
- <a class="tar_download_link" href="https://github.com/mnewt/prettify-wrapper/tarball/master">Download this project as a tar.gz file</a>
- </section>
</header>
</div>
@@ -37,21 +33,19 @@ <h2 id="project_tagline">Wraps Google Prettify into a nice little bow for easy i
<h1>Directions</h1>
-<p><strong>ONE</strong>: copy the code in <code>reference.html</code> into your web page, at the end of the file right before <code>&lt;/body&gt;</code>
+<p><strong>ONE</strong>: copy the code in below into your web page, at the end of the file right before <code>&lt;/body&gt;</code>
The end of your html template should look like this:</p>
-<div class="highlight"><pre><span class="c">&lt;!-- ======================= Begin Prettify ============================--&gt;</span>
- <span class="nt">&lt;link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">type=</span><span class="s">"text/css"</span> <span class="na">rel=</span><span class="s">"stylesheet"</span>
- <span class="na">href=</span><span class="s">"http://mnewt.github.com/prettify-wrapper/themes/tomorrow-mnewt.css"</span><span class="nt">&gt;</span>
- <span class="nt">&lt;script </span><span class="na">type=</span><span class="s">"text/javascript"</span>
- <span class="na">src=</span><span class="s">"https://raw.github.com/mnewt/prettify-wrapper/master/google-code-prettify/src/prettify.js"</span><span class="nt">&gt;</span>
- <span class="nt">&lt;/script&gt;</span>
- <span class="nt">&lt;script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"https://raw.github.com/mnewt/prettify-wrapper/master/styleCode.js"</span><span class="nt">&gt;</span>
- <span class="nt">&lt;/script&gt;</span>
-<span class="c">&lt;!-- ======================== End Prettify =============================--&gt;</span>
-<span class="nt">&lt;/body&gt;</span>
-<span class="nt">&lt;/html&gt;</span>
-</pre></div>
+<pre><code>&lt;!-- ======================= Begin Prettify ============================--&gt;
+ &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;
+ href=&quot;http://mnewt.github.com/prettify-wrapper/themes/prettify.css&quot;&gt;
+ &lt;script type=&quot;text/javascript&quot;
+ src=&quot;http://mnewt.github.com/prettify-wrapper/google-code-prettify/src/prettify.js&quot;&gt;
+ &lt;/script&gt;
+ &lt;script type=&quot;text/javascript&quot;
+ src=&quot;http://mnewt.github.com/prettify-wrapper/styleCode.js&quot;&gt;&lt;/script&gt;
+&lt;!-- ======================== End Prettify =============================--&gt;
+</code></pre>
<p><strong>TWO</strong>: (optional): customize the theme by pointing the first line to a different CSS file, such as this one:
<a href="https://raw.github.com/mnewt/prettify-wrapper/master/tomorrow-night-mnewt.css">https://raw.github.com/mnewt/prettify-wrapper/master/tomorrow-night-mnewt.css</a></p>
@@ -95,6 +89,15 @@ <h2 id="project_tagline">Wraps Google Prettify into a nice little bow for easy i
} catch(err) {}
</script>
+<!-- ======================= Begin Prettify ============================-->
+ <link rel="stylesheet" type="text/css" rel="stylesheet"
+ href="http://mnewt.github.com/prettify-wrapper/themes/prettify.css">
+ <script type="text/javascript"
+ src="http://mnewt.github.com/prettify-wrapper/google-code-prettify/src/prettify.js">
+ </script>
+ <script type="text/javascript"
+ src="http://mnewt.github.com/prettify-wrapper/styleCode.js"></script>
+<!-- ======================== End Prettify =============================-->
</body>
</html>
View
1  params.json
@@ -1 +0,0 @@
-{"note":"Don't delete this file! It's used internally to help with page regeneration.","tagline":"Wraps Google Prettify into a nice little bow for easy inclusion into any website or blog","body":"google-code-prettify wrapper\r\n=======================\r\n\r\nThis repository serves up google prettify. It allows you to add code highlighting to any page without hosting any files. It has no external dependencies--just pure javascript.\r\n\r\n\r\n# Directions\r\n\r\n**ONE**: copy the code in `reference.html` into your web page, at the end of the file right before `</body>`\r\nThe end of your html template should look like this:\r\n\r\n```html\r\n<!-- ======================= Begin Prettify ============================-->\r\n <link rel=\"stylesheet\" type=\"text/css\" rel=\"stylesheet\"\r\n href=\"http://mnewt.github.com/prettify-wrapper/tomorrow-mnewt.css\">\r\n <script type=\"text/javascript\"\r\n src=\"https://raw.github.com/mnewt/prettify-wrapper/master/google-code-prettify/src/prettify.js\">\r\n </script>\r\n <script type=\"text/javascript\" src=\"https://raw.github.com/mnewt/prettify-wrapper/master/styleCode.js\">\r\n </script>\r\n<!-- ======================== End Prettify =============================-->\r\n</body>\r\n</html>\r\n```\r\n**TWO**: (optional): customize the theme by pointing the first line to a different CSS file, such as this one:\r\nhttps://raw.github.com/mnewt/prettify-wrapper/master/tomorrow-night-mnewt.css\r\n\r\n\r\n# Themes\r\n\r\nThere are a few themes included in the package itself:\r\nhttp://google-code-prettify.googlecode.com/svn/trunk/styles/index.html\r\n\r\n[jmblog](https://github.com/jmblog) maintains some nice themes:\r\nhttp://jmblog.github.com/color-themes-for-google-code-prettify/","name":"Prettify-wrapper","google":"UA-33958216-1"}
Please sign in to comment.
Something went wrong with that request. Please try again.