Giter Club home page Giter Club logo

google-code-prettify's Introduction

Google Code Prettify

Direct port of svn into git from http://google-code-prettify.googlecode.com/svn/trunk/

Install

via Bower

bower install google-code-prettify

or Yeoman

yeoman install google-code-prettify

Usage

The prettify script is AMD compatible and can be used modularly. Here is an example of it in an AMD module:

define(['jquery', 'prettify'], function($, prettify){
	var code = null;
	$('pre').addClass('prettyprint').each(function(idx, el){
			code = el.firstChild;
			code.innerHTML = prettify.prettyPrintOne(code.innerHTML);
		})
	);
});

This version of google-code-prettify defines an anonymous module, which is more flexible. To allow your AMD loader to find google-code-prettify with a more convenient name, map a path to it as follows:

// using RequireJS
require.config({
	prettify: 'bower_components/google-code-prettify/prettify'
});

// using curl.js
curl.config({
	prettify: 'bower_components/google-code-prettify/prettify'
});

Or it may just be used in a global context like the following:

(function(){
	$('pre').addClass('prettyprint');
	prettyPrint();
})();

More information can be found in the original README.html

google-code-prettify's People

Contributors

spencewood avatar ebidel avatar mattdsteele avatar michaeloboyle avatar vladgurovich avatar taballa avatar unscriptable avatar

Watchers

James Cloos avatar Wheeler Law avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.