{"id":22052,"date":"2013-02-15T13:48:03","date_gmt":"2013-02-15T13:48:03","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/prettify-code-syntax\/"},"modified":"2013-03-21T07:54:48","modified_gmt":"2013-03-21T07:54:48","slug":"prettify-code-syntax","status":"publish","type":"plugin","link":"https:\/\/szl.wordpress.org\/plugins\/prettify-code-syntax\/","author":11659251,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2.1","stable_tag":"1.2.1","tested":"3.5.2","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"Prettify Code Syntax","header_author":"Jes\u00fas Carrera","header_description":"","assets_banners_color":"","last_updated":"2013-03-21 07:54:48","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_s-xclick&hosted_button_id=LEJAVTJUGWE3E","header_plugin_uri":"http:\/\/www.frontendmatters.com\/open-source\/wordpress-plugins\/prettify-code-syntax\/","header_author_uri":"http:\/\/www.frontendmatters.com\/","rating":4.2,"author_block_rating":0,"active_installs":80,"downloads":15596,"num_ratings":12,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":"1","2":0,"3":"1","4":"4","5":"6"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.0.1","1.0.2","1.1","1.1.1","1.2.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"673875","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"673875","resolution":"2","location":"assets"}},"screenshots":{"1":"Language options","2":"Style options"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1214,4444,1119,18603,2207],"plugin_category":[],"plugin_contributors":[84817],"plugin_business_model":[],"class_list":["post-22052","plugin","type-plugin","status-publish","hentry","plugin_tags-code","plugin_tags-highlighter","plugin_tags-markup","plugin_tags-prettify","plugin_tags-syntax","plugin_contributors-jesucarr","plugin_committers-jesucarr"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/prettify-code-syntax.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/prettify-code-syntax\/assets\/screenshot-1.png?rev=673875","caption":"Language options"},{"src":"https:\/\/ps.w.org\/prettify-code-syntax\/assets\/screenshot-2.png?rev=673875","caption":"Style options"}],"raw_content":"<!--section=description-->\n<p>The main reason for the development of this plugin was the lack of options supporting the <strong>HTML5 recommendation<\/strong>, where the code snippets should be tagged with <code>pre<\/code> followed by <code>code<\/code>, and optionally a class starting with <code>language-<\/code> and then our language.<\/p>\n\n<p>You can use the plugin like this:<\/p>\n\n<pre><code>&lt;pre class=\"prettyprint\"&gt;&lt;code class=\"language-php\"&gt;\n\/\/ my code\n&lt;\/code&gt;&lt;\/pre&gt;\n<\/code><\/pre>\n\n<p>Also very important is that although this plugin loads different files depending on your configuration, it fully <strong>supports caching<\/strong> scripts (<a href=\"http:\/\/wordpress.org\/extend\/plugins\/w3-total-cache\/\">W3 Total Cache<\/a>) to concatenate and compress all the css and js, so the impact in performance will be minimum.<\/p>\n\n<h4>Languages<\/h4>\n\n<p>This syntax highlighter is based on <a href=\"http:\/\/google-code-prettify.googlecode.com\/svn\/trunk\/README.html\">Google Code Prettify<\/a> and should work on a number of languages including <strong>C<\/strong> and friends, <strong>Java<\/strong>, <strong>Python<\/strong>, <strong>Bash<\/strong>, <strong>SQL<\/strong>, <strong>HTML<\/strong>, <strong>XML<\/strong>, <strong>Javascript<\/strong>, <strong>Makefiles<\/strong>, and Rust. It works passably on <strong>Ruby<\/strong>, <strong>PHP<\/strong>, <strong>VB<\/strong>, and <strong>Awk<\/strong> and a decent subset of <strong>Perl<\/strong> and <strong>Ruby<\/strong>, but, because of commenting conventions, doesn't work on Smalltalk.<\/p>\n\n<p>Other languages are supported via an extension (plugin options):  <strong>CSS<\/strong>, <strong>SQL<\/strong>, <strong>YAML<\/strong>, <strong>Visual Basic<\/strong>, <strong>Clojure<\/strong>, <strong>Scala<\/strong>, <strong>Latek (TeX, LaTeX)<\/strong>, <strong>WikiText<\/strong>, <strong>Erlang<\/strong>, <strong>Go<\/strong>, <strong>Haskell<\/strong>, <strong>Lua<\/strong>, <strong>OCAML<\/strong>, <strong>SML<\/strong>, <strong>F#<\/strong>, <strong>Nemerle<\/strong>, <strong>Protocol Buffers<\/strong>, <strong>CHDL (VHDL)<\/strong>, <strong>XQ (XQuery)<\/strong>, <strong>Lisp, Scheme<\/strong>, <strong>Dart<\/strong>, <strong>Llvm<\/strong>, <strong>Mumps<\/strong>, <strong>Pascal<\/strong>, <strong>R, S<\/strong>, <strong>RD<\/strong>, <strong>TCL<\/strong><\/p>\n\n<h4>Styles<\/h4>\n\n<p><strong>Four<\/strong> different styles are provided, and they can be previewed in the plugin options. They are modified to make sure they don't clash with any other styles in your theme.<\/p>\n\n<p>You have also the option to include your <strong>custom style<\/strong>.<\/p>\n\n<p>If you have a style that would like to see included in the option list, just <a href=\"http:\/\/www.frontendmatters.com\/contact\/\">contact me<\/a>, or <a href=\"https:\/\/github.com\/jesucarr\/wordpress-prettify-code-syntax\">fork me<\/a>.<\/p>\n\n<h4>Notes<\/h4>\n\n<ul>\n<li><p>Plugin options are at Settings &gt; Prettify Code Syntax. Have a look at the Screenshots tab to see how it looks like.<\/p><\/li>\n<li><p>If you don't care too much about the HTML5 recommendation, you can skip the <code>language-<\/code> class. The code always gets detected automatically.<\/p><\/li>\n<li><p>It will also work if you only use a <code>pre<\/code> tag without the <code>code<\/code> tag (but long lines will be wrapped instead of get horizontal scroll), or if you only use a <code>code<\/code> tag with the <code>prettyprint<\/code> class (but if you don't use <code>pre<\/code> your spaces\/returns won't be maintained.)<\/p><\/li>\n<li><p>Be careful using the Visual Editor tab when inserting code, as some HTML tags will be modified or removed.<\/p><\/li>\n<li><p>Using a chaching plugin like W3 Total Cache is highly recommended.<\/p><\/li>\n<\/ul>\n\n<h4>Demo<\/h4>\n\n<p>You can find a <a href=\"http:\/\/www.frontendmatters.com\/open-source\/wordpress-plugins\/prettify-code-syntax\/\">front end demo<\/a> here a the bottom.<\/p>\n\n<!--section=installation-->\n<p>In your Wordpress installation go to Plugins &gt; Add New, and search for \"prettify code syntax\" to find and install it automatically.<\/p>\n\n<p>You can also install it manually:<\/p>\n\n<ol>\n<li>Download the plugin and upload the contents to the <code>\/wp-content\/plugins\/<\/code> directory, using FTP or the Upload tab in Plugins &gt; Add New.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Change settings if neccessary at Settings &gt; Prettify Code Syntax<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>I want to add the tags `` or `` to my code, how can I do it without breaking the snippet?<\/dt>\n<dd><p>You can add a space before the closing <code>&gt;<\/code>, like this <code>&lt;\/code &gt;<\/code><\/p><\/dd>\n<dt>I found a bug, or have some code improvements, or have something to ask about the plugin. How do I contact you?<\/dt>\n<dd><p>Best thing with anything related to code would be to <a href=\"https:\/\/github.com\/jesucarr\/wordpress-prettify-code-syntax\">fork me or open an issue<\/a>. For anything else you can <a href=\"http:\/\/www.frontendmatters.com\/open-source\/wordpress-plugins\/prettify-code-syntax\/\">post a comment<\/a> or <a href=\"http:\/\/www.frontendmatters.com\/contact\/\">contact me<\/a>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.2<\/h4>\n\n<ul>\n<li>Add Twitter Bootstrap style<\/li>\n<li>Isolate default style. Every style now is independent<\/li>\n<li>Fix bug where all languages were loaded<\/li>\n<li>Code refactoring<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Add new languages<\/li>\n<li>Several fixes and code refactoring<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>First release<\/li>\n<\/ul>","raw_excerpt":"Code syntax highlighter using Google Prettify, supporting the HTML5 recommendation, and caching plugins.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/22052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=22052"}],"author":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/jesucarr"}],"wp:attachment":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=22052"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=22052"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=22052"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=22052"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=22052"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=22052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}