Skip to content
Browse files

updated README

  • Loading branch information...
1 parent 0e75af6 commit ebfb4729beb04d84327bab041995b8557c94c0d9 @mnewt committed Aug 7, 2012
Showing with 183 additions and 50 deletions.
  1. +16 −21 README.md
  2. +35 −29 reference.html
  3. +132 −0 tomorrow-night-mnet.css
View
37 README.md
@@ -1,34 +1,29 @@
-google-prettify-wrapper
+google-code-prettify wrapper
=======================
-Wraps Google Prettify into a nice little bow for easy inclusion into any website or blog
+Wraps Google Code Prettify into a nice little bow for easy inclusion into any website or blog. Nothing new has been created here, it is packaged up nicely.
# Directions
1. copy the code in `reference.html` into your web page, at the end of the file right before `</body>`
The end of your html template should look like this:
```html
-<!--
-===================================================
- Begin Google Prettify
-===================================================
--->
- <link rel="stylesheet"
- href="http://jmblog.github.com/color-themes-for-google-code-prettify/css/themes/tomorrow-night.css">
-
- <script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"
- type="text/javascript"></script>
-
- <script src="https://raw.github.com/mnewt/google-prettify-wrapper/master/styleCode.js"
- type="text/javascript"></script>
-<!--
-===================================================
- End Google Prettify
-===================================================
--->
+<!-- ======================= Begin Prettify ============================-->
+ <link rel="stylesheet" href="google-code-prettify/src/prettify.css">
+ <script src="google-code-prettify-min/prettify.js" type="text/javascript"></script>
+ <script src="styleCode.js" type="text/javascript"></script>
+<!-- ======================== End Prettify =============================-->
</body>
</html>
```
2. enjoy
-3. if you like, you can customize the theme by pointing the first line to a different CSS file
+3. if you like, you can customize the theme by pointing the first line to a different CSS file
+
+# Themes
+
+There are a few themes included in the package itself:
+http://google-code-prettify.googlecode.com/svn/trunk/styles/index.html
+
+(https://github.com/jmblog)[jmblog] maintains some nice themes:
+http://jmblog.github.com/color-themes-for-google-code-prettify/
View
64 reference.html
@@ -2,38 +2,44 @@
<html>
<body>
-<h1>Code is below:</h1>
+<h1>There is some code below for demonstration purposes:</h1>
<pre>
<code>
-require 'rubygems'
-require 'typhoeus'
-require 'json'
-
-# the request object
-request = Typhoeus::Request.new("http://localhost:3000")
- # :body => "this is a request body",
- # :method => :post,
- # :headers => {:Accept => "text/html"},
- # :timeout => 100, # milliseconds
- # :cache_timeout => 60, # seconds
- # :params => {:field1 => "a field"})
-# we can see from this that the first argument is the url. the second is a set of options.
-# the options are all optional. The default for :method is :get. Timeout is measured in milliseconds.
-# cache_timeout is measured in seconds.
-
-# Run the request via Hydra.
-hydra = Typhoeus::Hydra.new
-hydra.queue(request)
-hydra.run
-
-# the response object will be set after the request is run
-response = request.response
-response.code # http status code
-response.time # time in seconds the request took
-response.headers # the http headers
-response.headers_hash # http headers put into a hash
-response.body # the response body
+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 styleCode()
+{
+ if (typeof disableStyleCode != "undefined")
+ {
+ 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]);
+ a = true;
+ }
+ if (a) { prettyPrint() }
+}
+
+
+
+window.onload = function() { styleCode(); };
</code>
</pre>
View
132 tomorrow-night-mnet.css
@@ -0,0 +1,132 @@
+/* Tomorrow Night Theme */
+/* Original theme - https://github.com/chriskempson/tomorrow-theme */
+/* Pretty printing styles. Used with prettify.js. */
+/* SPAN elements with the classes below are added by prettyprint. */
+/* plain text */
+
+.pln {
+ color: #c5c8c6; }
+
+@media screen {
+ /* string content */
+ .str {
+ color: #b5bd68; }
+
+ /* a keyword */
+ .kwd {
+ color: #b294bb; }
+
+ /* a comment */
+ .com {
+ color: #969896; }
+
+ /* a type name */
+ .typ {
+ color: #81a2be; }
+
+ /* a literal value */
+ .lit {
+ color: #de935f; }
+
+ /* punctuation */
+ .pun {
+ color: #c5c8c6; }
+
+ /* lisp open bracket */
+ .opn {
+ color: #c5c8c6; }
+
+ /* lisp close bracket */
+ .clo {
+ color: #c5c8c6; }
+
+ /* a markup tag name */
+ .tag {
+ color: #cc6666; }
+
+ /* a markup attribute name */
+ .atn {
+ color: #de935f; }
+
+ /* a markup attribute value */
+ .atv {
+ color: #8abeb7; }
+
+ /* a declaration */
+ .dec {
+ color: #de935f; }
+
+ /* a variable name */
+ .var {
+ color: #cc6666; }
+
+ /* a function name */
+ .fun {
+ color: #81a2be; } }
+/* Use higher contrast and text-weight for printable form. */
+@media print, projection {
+ .str {
+ color: #060; }
+
+ .kwd {
+ color: #006;
+ font-weight: bold; }
+
+ .com {
+ color: #600;
+ font-style: italic; }
+
+ .typ {
+ color: #404;
+ font-weight: bold; }
+
+ .lit {
+ color: #044; }
+
+ .pun, .opn, .clo {
+ color: #440; }
+
+ .tag {
+ color: #006;
+ font-weight: bold; }
+
+ .atn {
+ color: #404; }
+
+ .atv {
+ color: #060; } }
+/* Style */
+pre.prettyprint {
+ background: #1d1f21;
+ /* font-family: Menlo, Monaco, Consolas, monospace; */
+ font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
+ font-size: 11px;
+ line-height: 1.5;
+ border: 1px solid #ccc;
+ padding: 10px; }
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums {
+ margin-top: 0;
+ margin-bottom: 0; }
+
+/* IE indents via margin-left */
+li.L0,
+li.L1,
+li.L2,
+li.L3,
+li.L4,
+li.L5,
+li.L6,
+li.L7,
+li.L8,
+li.L9 {
+ /* */ }
+
+/* Alternate shading for lines */
+li.L1,
+li.L3,
+li.L5,
+li.L7,
+li.L9 {
+ /* */ }

0 comments on commit ebfb472

Please sign in to comment.
Something went wrong with that request. Please try again.