{"id":16358,"date":"2012-01-09T20:44:25","date_gmt":"2012-01-09T20:44:25","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-coffeescript\/"},"modified":"2012-01-09T20:51:42","modified_gmt":"2012-01-09T20:51:42","slug":"wp-coffeescript","status":"publish","type":"plugin","link":"https:\/\/os.wordpress.org\/plugins\/wp-coffeescript\/","author":7798430,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0","stable_tag":"1.0","tested":"3.3.2","requires":"3.0","requires_php":"","requires_plugins":"","header_name":"WP CoffeeScript","header_author":"Tom Benner","header_description":"","assets_banners_color":"","last_updated":"2012-01-09 20:51:42","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/wp-coffeescript\/","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":10,"downloads":1640,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[8864,17401,734,229,1731],"plugin_category":[59],"plugin_contributors":[85113],"plugin_business_model":[],"class_list":["post-16358","plugin","type-plugin","status-publish","hentry","plugin_tags-coffeescript","plugin_tags-cs","plugin_tags-development","plugin_tags-javascript","plugin_tags-js","plugin_category-utilities-and-tools","plugin_contributors-tombenner","plugin_committers-tombenner"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-coffeescript.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>WP CoffeeScript is a WordPress plugin that makes enqueueing <a href=\"http:\/\/coffeescript.org\">CoffeeScript<\/a> as easy as enqueueing JavaScript.  Instead of using <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_enqueue_script\"><code>wp_enqueue_script()<\/code><\/a>, as you would for JS, you just use <code>enqueue_coffeescript()<\/code>, which takes almost exactly the same arguments.  The only difference is that the second argument should be the file path instead of the URL.  If you'd like to compile multiple CS files into a single JS file, you can use an array of file paths as the second argument.<\/p>\n\n<p>Please note that the <a href=\"http:\/\/coffeescript.org\/#installation\">CoffeeScript executable<\/a> must be installed on the server.  You can also set a custom path to the executable (see the <a href=\"https:\/\/github.com\/tombenner\/wp-coffeescript\">examples<\/a>).<\/p>\n\n<p>If you'd like to grab development releases, see what new features are being added, or browse the source code please visit the <a href=\"http:\/\/github.com\/tombenner\/wp-coffeescript\">GitHub repo<\/a>.<\/p>\n\n<h3>Examples<\/h3>\n\n<p>Enqueue a CoffeeScript file that's in the theme directory:<\/p>\n\n<pre><code>enqueue_coffeescript('my-handle', get_template_directory().'\/my-script.coffee');\n<\/code><\/pre>\n\n<p>Enqueue multiple CS files, compiling them into a single output file:<\/p>\n\n<pre><code>$script1 = get_template_directory().'\/script1.coffee';\n$script2 = get_template_directory().'\/script2.coffee';\nenqueue_coffeescript('my-handle', array($script1, $script2));\n<\/code><\/pre>\n\n<p>Enqueue a CS file in the footer with dependencies (the arguments are exactly the same as in <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_enqueue_script\"><code>wp_enqueue_script()<\/code><\/a>):<\/p>\n\n<pre><code>enqueue_coffeescript('my-handle', get_template_directory().'\/my-script.coffee', array('dep1', 'dep2'), false, true);\n<\/code><\/pre>\n\n<p>Set a custom path to the CS executable (the default value is <code>coffeescript<\/code>):<\/p>\n\n<pre><code>add_filter('wpcs_executable', 'set_wpcs_executable');\nfunction set_wpcs_executable($path) {\n    return '\/my\/path\/to\/coffeescript';\n}\n<\/code><\/pre>\n\n<p>Compile the CS on every page load (the default behavior is to only compile when the JS has been modified):<\/p>\n\n<pre><code>add_filter('wpcs_caching_enabled', 'disable_wpcs_caching');\nfunction disable_wpcs_caching($is_enabled) {\n    return false;\n}\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Put <code>wp-coffeescript<\/code> into the <code>wp-content\/plugins<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Make sure that the <a href=\"http:\/\/coffeescript.org\/#installation\">CoffeeScript executable<\/a> is installed on the server or set a custom path to the executable (see the <a href=\"https:\/\/github.com\/tombenner\/wp-coffeescript\">examples<\/a>)<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Where should I go for support questions or to ask for a new feature?<\/dt>\n<dd><p>Please feel free to either add a topic in the WordPress forum or contact me through GitHub for any questions:<\/p>\n\n<ul>\n<li><a href=\"http:\/\/wordpress.org\/tags\/wp-coffeescript?forum_id=10\">WordPress Forum<\/a><\/li>\n<li><a href=\"http:\/\/github.com\/tombenner\">GitHub<\/a><\/li>\n<\/ul><\/dd>\n\n<\/dl>","raw_excerpt":"Allows developers to easily use CoffeeScript in WordPress. Simply use enqueue_coffeescript(); the compilation is done automatically behind the scenes.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/16358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=16358"}],"author":[{"embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/tombenner"}],"wp:attachment":[{"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=16358"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=16358"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=16358"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=16358"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=16358"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/os.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=16358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}