{"id":19366,"date":"2012-08-14T19:59:12","date_gmt":"2012-08-14T19:59:12","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-colored-coding\/"},"modified":"2014-09-05T11:13:46","modified_gmt":"2014-09-05T11:13:46","slug":"wp-colored-coding","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/wp-colored-coding\/","author":9720549,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2014.08.19","stable_tag":"2014.08.19","tested":"4.0.38","requires":"3.9.2","requires_php":"","requires_plugins":"","header_name":"WP Colored Coding","header_author":"David Naber","header_description":"","assets_banners_color":"","last_updated":"2014-09-05 11:13:46","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/dnaber.de\/blog\/2012\/wordpress-plugin-colored-coding\/","header_author_uri":"http:\/\/dnaber.de\/","rating":0,"author_block_rating":0,"active_installs":10,"downloads":2660,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"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.1.0","1.2","2014.08.19"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"968391","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"968391","resolution":"2","location":"assets"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"968391","resolution":"3","location":"assets"}},"screenshots":{"1":"The Meta-Box on post edit screen to manage your code snippeds.","2":"TinyMCE popup to build and insert shortcode into the text editor.","3":"WP Colored Coding settings section."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[68083,68082,4609],"plugin_category":[],"plugin_contributors":[80613],"plugin_business_model":[],"class_list":["post-19366","plugin","type-plugin","status-publish","hentry","plugin_tags-code-samples","plugin_tags-rainbow-js","plugin_tags-syntax-highlighting","plugin_contributors-dnaber-de","plugin_committers-dnaber-de"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-colored-coding.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-colored-coding\/assets\/screenshot-1.png?rev=968391","caption":"The Meta-Box on post edit screen to manage your code snippeds."},{"src":"https:\/\/ps.w.org\/wp-colored-coding\/assets\/screenshot-2.png?rev=968391","caption":"TinyMCE popup to build and insert shortcode into the text editor."},{"src":"https:\/\/ps.w.org\/wp-colored-coding\/assets\/screenshot-3.png?rev=968391","caption":"WP Colored Coding settings section."}],"raw_content":"<!--section=description-->\n<p>Brings the cool Javascript syntax highlighter <a href=\"https:\/\/github.com\/ccampbell\/rainbow\">Rainbow.js<\/a> to your Wordpress-Blog and allows you to manage code snippets independend from the text editor.<\/p>\n\n<p><strong>IMPORTANT! \u2013 This plugin is no longer testet with PHP 5.2!<\/strong><\/p>\n\n<h4>Quick Start<\/h4>\n\n<ol>\n<li>Download the plugin from this page<\/li>\n<li>Follow the instructions on the <a href=\"http:\/\/codex.wordpress.org\/Managing_Plugins#Manual_Plugin_Installation\">Wordpress Codex<\/a> to install the plugin.\nBy default, the plugin is ready for use after activation. Some options can be changed on Settings \u2192 Writing.<\/li>\n<\/ol>\n\n<p>For a detailed usage manual refer to the  <a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-colored-coding\/other_notes\/#usage\">Usage section<\/a>, or \u2013 better than a thousand words \u2013 to the <a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-colored-coding\/screenshots\/\">screenshots<\/a>.<\/p>\n\n<p>If you want to change the behaviour of the plugin see the <a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-colored-coding\/other_notes\/#API\">API-Documentation<\/a><\/p>\n\n<p>\n\n<\/p>\n\n<h3>Settings<\/h3>\n\n<p>By default, the plugin is ready for use after activation. Some options can be changed on Settings \u2192 Writing.<\/p>\n\n<h4>Raw output<\/h4>\n\n<p>This option enables an additional checkbox for each codeblock of a post which allows you to disable the <code>esc_attr()<\/code> filter for that code snippet. That means, every HTML and Javascript inside this textarea will be parsed by the browser as those. So be carefull with this option.<\/p>\n\n<h3>Usage<\/h3>\n\n<h4>Codeblocks<\/h4>\n\n<p>A single Codeblock is identified (in the posts context) by its name. If you don't want to specify a name for each block, leave it empty, it will be generated automatically.<\/p>\n\n<p>The language field is also optional. To use syntax highlighting, write in a rainbow supported language. (It will give you suggestions.) Currently these are\n* C\n* Coffeescript\n* C#\n* CSS\n* Go\n* HTML\n* Java\n* JavaScript\n* Lua\n* PHP\n* Python\n* R\n* Ruby\n* Shell\n* Smalltalk<\/p>\n\n<p>Each codeblock can be placed anywhere in the text by using the shortcode <code>[cc name=\"{name}\"]<\/code>. You can use the TinyMCE button \u00bbCC\u00ab for that.<\/p>\n\n<h4>Shortcode (in-text code)<\/h4>\n\n<p>For just a few lines of code you may want to use the shortcode like this:<\/p>\n\n<pre><code>[cc lang=\"javascript\"]\nvar str = 'Hello World';\nalert( str );\n[\/cc]\n<\/code><\/pre>\n\n<h3>Contribution &amp; Bug-Report<\/h3>\n\n<p>For bug reports or ideas for new features, please use the <a href=\"https:\/\/github.com\/dnaber-de\/WP-Colored-Coding\/issues\">issue tracker on gitub<\/a>.<\/p>\n\n<h3>API<\/h3>\n\n<p>The following filters are provided:<\/p>\n\n<ul>\n<li><code>wp_cc_rainbow_themes<\/code><\/li>\n<li><code>wp_cc_rainbow_scripts<\/code><\/li>\n<li><code>wp_cc_rainbow_languages<\/code><\/li>\n<\/ul>\n\n<p>Adding a new Theme is quite easy. Just expend the themes-array by a key like this<\/p>\n\n<pre><code>\/**\n * @param array $themes\n * @return array\n *\/\nfunction my_new_rainbow_theme( $themes ) {\n    $themes[ 'my_theme' ] = array(\n        'src'  =&gt; \/\/the absolute URI to the stylesheet\n        'name' =&gt; 'My Theme'\n    );\n\n    return $themes;\n}\nadd_filter( 'wp_cc_rainbow_themes', 'my_new_rainbow_theme' );\n<\/code><\/pre>\n\n<p>To add a supported language use<\/p>\n\n<pre><code>\/**\n * @param array $scripts\n * @return array\n *\/\nfunction my_new_rainbow_script( $scripts ) {\n    $scripts[ 'my_new_lang' ] = array(\n        'src'       =&gt; \/\/the absolute URI to the script\n        'depth'     =&gt; array( 'rainbow' ),\n        'lang'      =&gt; 'my_new_lang',\n        'in_footer' =&gt; TRUE # this must be equal with the script it depends on\n    );\n\n    # to override the built-in rainbow version use the key 'rainbow'\n\n    return $scripts;\n}\nadd_filter( 'wp_cc_rainbow_scripts', 'my_new_rainbow_script' );\n\n\/**\n * @param array $langs\n * @return array\n *\/\nfunction my_new_lang( $langs ) {\n\n    $langs[ 'my_new_lang' ] = 'My new lang';\n\n    return $langs;\n}\nadd_filter( 'wp_cc_rainbow_languages', 'my_new_lang' );\n<\/code><\/pre>\n\n<h4>Deactivation\/Uninstallation<\/h4>\n\n<p>If you deactivate the plugin all settings and codes will be preserved. On uninstallation (delete), all settings and codes will be deleted finally. If this is triggered from the network-admin page, all blogs will be cleaned up.<\/p>\n\n<h3>Acknowledgement<\/h3>\n\n<ul>\n<li>Thanks to <a href=\"https:\/\/github.com\/sparanoid\">sparanoid<\/a> for chinese translation<\/li>\n<li>Thanks to <a href=\"https:\/\/twitter.com\/Volleyballfisch\">@volleyballfisch<\/a> for spanish translation<\/li>\n<li>Thanks to <a href=\"https:\/\/github.com\/yonjah\">yonjah<\/a> for JS Bugfixing<\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>Just <a href=\"https:\/\/github.com\/dnaber-de\/WP-Colored-Coding\/releases\">download<\/a> the latest tag and follow the instructions on the <a href=\"http:\/\/codex.wordpress.org\/Managing_Plugins#Manual_Plugin_Installation\">Wordpress Codex<\/a>. Otherwise you can use the plugin installer in your WordPress backend.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>Are there any frequently asked questions?<\/dt>\n<dd><p>None so far. If you have any questions feel free to <a href=\"http:\/\/dnaber.de\/kontakt\">contact<\/a> me (english, german) or use the <a href=\"http:\/\/wordpress.org\/support\/plugin\/wp-colored-coding\">support forum<\/a> on wordpress.org.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2014.08.19<\/h4>\n\n<ul>\n<li>Adaption to TinyMCE version 4.*<\/li>\n<li>Update Rainbow.js to version 1.2<\/li>\n<li>Some security enhancements<\/li>\n<li>Bugfixes<\/li>\n<li>Changed version number format<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>fixed a bug of the unfiltered output option<\/li>\n<li>better readme.txt for wordpress.org<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>spanish language files<\/li>\n<li>rainbow support for Go, R, Coffeescript, Java, Smalltalk<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>bugfix<\/li>\n<li>Theme Technicolor updated<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>initial release<\/li>\n<\/ul>","raw_excerpt":"Syntax highlighting with Rainbow.js.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/19366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=19366"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/dnaber-de"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=19366"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=19366"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=19366"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=19366"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=19366"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=19366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}