{"id":19460,"date":"2012-08-14T03:10:54","date_gmt":"2012-08-14T03:10:54","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/goodbye-syntax-highlighter\/"},"modified":"2013-02-11T17:05:54","modified_gmt":"2013-02-11T17:05:54","slug":"goodbye-syntax-highlighter","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/goodbye-syntax-highlighter\/","author":7715869,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.1.2","stable_tag":"0.1.2","tested":"3.5.2","requires":"3.1","requires_php":"","requires_plugins":"","header_name":"goodbye-syntax-highlighter","header_author":"Damien White (Visoft, Inc.)","header_description":"","assets_banners_color":"","last_updated":"2013-02-11 17:05:54","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/www.visoftinc.com\/","header_plugin_uri":"https:\/\/github.com\/visoft\/goodbye-syntax-highlighter","header_author_uri":"http:\/\/www.visoftinc.com","rating":5,"author_block_rating":0,"active_installs":10,"downloads":3988,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1.0","0.1.1","0.1.2"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1214,3986,32776,11272,2207],"plugin_category":[],"plugin_contributors":[93193],"plugin_business_model":[],"class_list":["post-19460","plugin","type-plugin","status-publish","hentry","plugin_tags-code","plugin_tags-highlight","plugin_tags-highlight-js","plugin_tags-pre","plugin_tags-syntax","plugin_contributors-dwhitevisoft","plugin_committers-dwhitevisoft"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/goodbye-syntax-highlighter.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>For years I've used <a href=\"http:\/\/alexgorbatchev.com\/SyntaxHighlighter\/\">Alex Gorbatchev's SyntaxHighlighter<\/a>. It has served me well over the years. When I moved to WordPress I tried various plugins based on the library, such <a href=\"http:\/\/wordpress.org\/extend\/plugins\/syntaxhighlighter\/\">SyntaxHighlighter Evolved<\/a>.<\/p>\n\n<p>I've decided to start blogging using <a href=\"http:\/\/daringfireball.net\/projects\/markdown\/\">Markdown<\/a>. Making this move I needed to find a way to highlight various bits of source code in an easy way. There are many nice libraries that make this a snap, such as <a href=\"http:\/\/code.google.com\/p\/google-code-prettify\/\">google-code-prettify<\/a> or <a href=\"http:\/\/softwaremaniacs.org\/soft\/highlight\/en\/\">highlight.js<\/a>. In the end I decided to go with highlight.js, for the simple reason that it is automatic, working flawlessly with Markdown's code syntax output.<\/p>\n\n<p>Great, but my existing source code examples use SyntaxHighlighter's style for code blocks (using <code>&lt;pre class=\"brush: ruby;\" \/&gt;<\/code>, for example). I could have converted things in a few ways:<\/p>\n\n<ul>\n<li>Change the database<\/li>\n<li>Write a JS script to convert the <code>&lt;pre \/&gt;<\/code> structure to <code>&lt;pre&gt;&lt;code \/&gt;&lt;\/pre&gt;<\/code><\/li>\n<li>Write a JS script to call highlight.js' <code>highlightBlock<\/code> method<\/li>\n<li>Write a WP plugin and reformat things easily <strong>Ding Ding Ding<\/strong><\/li>\n<\/ul>\n\n<p>So there you have it. This WordPress plugin will go through and process your SyntaxHighlighter style blocks into ones that highlight.js works with out-of-the-box. It will also add the language that you have specified with the <code>brush<\/code> class and add it as a class on the <code>&lt;code \/&gt;<\/code> element (<a href=\"http:\/\/www.w3.org\/html\/wg\/drafts\/html\/master\/text-level-semantics.html#the-code-element\">following the HTML5 recommendation<\/a>). Nothing is changed in the DB, so if you decide to go back to SyntaxHighlighter, you can without any issues.<\/p>\n\n<h3>GeSHi<\/h3>\n\n<p>This plugin now supports conversion of <a href=\"http:\/\/qbnz.com\/highlighter\/\">GeSHi<\/a> style code blocks! Now you can move from plugins such as <a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-syntax\/\">WP-Syntax<\/a> and <a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-geshi-highlight\">WP-GeSHi-Highlight<\/a> to highlight.js.<\/p>\n\n<p>GeSHi uses the syntax that is <em>close<\/em> to SyntaxHighlighter, except instead of putting the language in the <code>class<\/code> attribute, it uses the <code>lang<\/code> attribute. Similar to the SyntaxHighligher conversion, it will go through and process your GeSHi style blocks into ones that highlight.js works with out-of-the-box. It will also add the language that you have specified with the <code>lang<\/code> attribute and add it as a <code>class<\/code> on the <code>&lt;code \/&gt;<\/code> element.<\/p>\n\n<!--section=installation-->\n<p>Installation is standard and straight forward.<\/p>\n\n<ol>\n<li>Upload the <code>goodbye-syntax-highlighter<\/code> folder (and all it's contents) to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>0.1.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>\n\n<h4>0.1.1<\/h4>\n\n<ul>\n<li>Modified output to use the HTML5 recommended syntax highlighting class names, e.g. <code>language-ruby<\/code>. For more information, see <a href=\"http:\/\/www.w3.org\/html\/wg\/drafts\/html\/master\/text-level-semantics.html#the-code-element\">the HTML5 spec<\/a><\/li>\n<\/ul>\n\n<h4>0.1.2<\/h4>\n\n<ul>\n<li>Added conversion of GeSHi style code blocks<\/li>\n<\/ul>","raw_excerpt":"For years I&#039;ve used Alex Gorbatchev&#039;s SyntaxHighlighter. It has served me well over the years. When I moved to WordPress I tried various plu &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/19460","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=19460"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/dwhitevisoft"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=19460"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=19460"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=19460"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=19460"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=19460"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=19460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}