From 59b772a0c283ccdcc2646dcaba0c227073e3b2c3 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 19 May 2014 09:56:17 -0400 Subject: [PATCH] Code fence highlighting --- README.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f5429c0..af548ef 100644 --- a/README.md +++ b/README.md @@ -17,23 +17,29 @@ ExecJS supports these runtimes: A short example: - require "execjs" - ExecJS.eval "'red yellow blue'.split(' ')" - # => ["red", "yellow", "blue"] +``` ruby +require "execjs" +ExecJS.eval "'red yellow blue'.split(' ')" +# => ["red", "yellow", "blue"] +``` A longer example, demonstrating how to invoke the CoffeeScript compiler: - require "execjs" - require "open-uri" - source = open("http://jashkenas.github.com/coffee-script/extras/coffee-script.js").read +``` ruby +require "execjs" +require "open-uri" +source = open("http://jashkenas.github.com/coffee-script/extras/coffee-script.js").read - context = ExecJS.compile(source) - context.call("CoffeeScript.compile", "square = (x) -> x * x", :bare => true) - # => "var square;\nsquare = function(x) {\n return x * x;\n};" +context = ExecJS.compile(source) +context.call("CoffeeScript.compile", "square = (x) -> x * x", :bare => true) +# => "var square;\nsquare = function(x) {\n return x * x;\n};" +``` # Installation - $ gem install execjs +``` +$ gem install execjs +``` # FAQ