{"id":51684,"date":"2016-10-23T13:51:03","date_gmt":"2016-10-23T13:51:03","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/codeblocks-extended\/"},"modified":"2019-06-05T02:46:21","modified_gmt":"2019-06-05T02:46:21","slug":"codeblocks-extended","status":"closed","type":"plugin","link":"https:\/\/gd.wordpress.org\/plugins\/codeblocks-extended\/","author":14810475,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.1","stable_tag":"trunk","tested":"5.2.24","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"Codeblocks Extended with PrismJS","header_author":"duplaja (Dan D.)","header_description":"","assets_banners_color":"f2f3f5","last_updated":"2019-06-05 02:46:21","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/dandulaney.com\/donate\/","header_plugin_uri":"https:\/\/dandulaney.com","header_author_uri":"https:\/\/dandulaney.com","rating":0,"author_block_rating":0,"active_installs":10,"downloads":1514,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.0":"<ul>\n<li>Initial Plugin Release<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":{"icon.svg":{"filename":"icon.svg","revision":"1520570","resolution":"","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"1520570","resolution":"1544x500","location":"assets","locale":""},"banner-1880x609.png":{"filename":"banner-1880x609.png","revision":"1520570","resolution":"1880x609","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1520570","resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1520378","resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1520378","resolution":"2","location":"assets","locale":""},"screenshot-3.PNG":{"filename":"screenshot-3.PNG","revision":"1520378","resolution":"3","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1520385","resolution":"3","location":"assets","locale":""},"screenshot-4.PNG":{"filename":"screenshot-4.PNG","revision":"1520378","resolution":"4","location":"assets","locale":""},"screenshot-4.png":{"filename":"screenshot-4.png","revision":"1520385","resolution":"4","location":"assets","locale":""}},"screenshots":{"1":"<p>Sample code block created with Codeblocks Extended. Notice the copy button in the top right corner.<\/p>","2":"<p>Code block with line highlighting.<\/p>","3":"<p>Visual Editor TinyMCE options.<\/p>","4":"<p>Text Editor Button<\/p>"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[125427,1214,12156,11272,48116],"plugin_category":[],"plugin_contributors":[125428],"plugin_business_model":[],"class_list":["post-51684","plugin","type-plugin","status-closed","hentry","plugin_tags-clipboardjs","plugin_tags-code","plugin_tags-code-highlighting","plugin_tags-pre","plugin_tags-prismjs","plugin_contributors-duplaja","plugin_committers-duplaja"],"banners":[],"icons":{"svg":"https:\/\/ps.w.org\/codeblocks-extended\/assets\/icon.svg?rev=1520570","icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/codeblocks-extended_f2f3f5.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/codeblocks-extended\/assets\/screenshot-1.png?rev=1520378","caption":"<p>Sample code block created with Codeblocks Extended. Notice the copy button in the top right corner.<\/p>"},{"src":"https:\/\/ps.w.org\/codeblocks-extended\/assets\/screenshot-2.png?rev=1520378","caption":"<p>Code block with line highlighting.<\/p>"},{"src":"https:\/\/ps.w.org\/codeblocks-extended\/assets\/screenshot-3.PNG?rev=1520378","caption":"<p>Visual Editor TinyMCE options.<\/p>"},{"src":"https:\/\/ps.w.org\/codeblocks-extended\/assets\/screenshot-4.PNG?rev=1520378","caption":"<p>Text Editor Button<\/p>"}],"raw_content":"<!--section=description-->\n<p>Codeblocks Extended with PrismJS was born of a personal need for a lightweight code highlighter, with special functionality. \nMany of the other PrismJS based plugins in the repository were either outdated, or were lacking features that I was looking for.<\/p>\n\n<p>Features:<\/p>\n\n<ul>\n<li>Integrates the latest PrismJS build, with the most common langauges used.<\/li>\n<li>Integrates the PrismJS line-numbers plugin, to automatically number lines of code.<\/li>\n<li>Integrates the PrismJS line-highlight plugin to allow you to highlight specific lines of code.<\/li>\n<li>Integrates ClipboardJS + custom jQuery to add a \"Copy to Clipboard\" button to each code block.<\/li>\n<li>Custom Text Editor button to wrap selected text with the most commmon <code>&lt;pre&gt;<\/code> and <code>&lt;code&gt;<\/code> classes, and replacing special characters with their HTML safe equivalents.<\/li>\n<li>Custom Visual Editor \/ TinyMCE dropdown button, with the most common languages to wrap selected text.<\/li>\n<li>Since this works via wrapping <code>&lt;pre&gt;<\/code> and <code>&lt;code&gt;<\/code> tags with classes, you can use all custom class settings that PrismJS offers.<\/li>\n<li>No shortcodes to mess with, so you don't have to worry about losing whitespace between editor modes.<\/li>\n<li>No settings page needed: Just activate it and go!<\/li>\n<\/ul>\n\n<p>For a full list of languages supported and more information on this plugin's use, please check out the FAQ.<\/p>\n\n<p>Note: This does NOT auto-detect the language. Most plugins that do so brute force the languages or require file extensions, resulting in a much heavier plugin. The decision was made to keep this as light-weight as possible.<\/p>\n\n<p>Note 2: This is designed to work with the Classic Editor. It does not currently work in Gutenberg blocks.<\/p>\n\n<p>Thanks to Mike @ <a href=\"https:\/\/wp-bullet.com\/\">WP Bullet<\/a> for the banner and icon.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/prism-js<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress<\/li>\n<li>That's it!<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>How do I highlight lines of code?<\/dt>\n<dd><p>You can specifiy lines to highlight using the data-line attribute of the <code>&lt;pre&gt;<\/code> tag, in the Text Editor.<\/p>\n\n<ul>\n<li>Single Line: data-line=\"7\"<\/li>\n<li>Range: data-line=\"3-9\"<\/li>\n<li>Combination: data-line=\"2,4-6,9-12\"<\/li>\n<\/ul><\/dd>\n<dt>What other cool things can I do?<\/dt>\n<dd><ul>\n<li>You can link to individual lines of code, using href=\"#{pre-element-id}.{lines}\". Ex: href=\"#preblockone.5-6\".<\/li>\n<li>If you are comfortable, you can rebuild prism.min.js to include other languages than the ones below, or modify your CSS.<\/li>\n<li>Learn how this plugin was built, from start to end (and build your own version) <a href=\"https:\/\/www.wptechguides.com\/code-blocks-with-highlighting-beginning\/\">Build Your Own<\/a><\/li>\n<\/ul><\/dd>\n<dt>How do I specify a language if it's not one of the defaults on the dropdown?<\/dt>\n<dd><p>You can specifiy languages using the language-xxxx class of the <code>&lt;pre&gt;<\/code> and <code>&lt;code&gt;<\/code> tags via the Text Editor.<\/p>\n\n<p>For the sake of plugin size and speed, only the most common languages were included in this plugin. See below for the complete list.<\/p>\n\n<p>For a list of class names, you can look here on the official PrismJS site: <a href=\"http:\/\/prismjs.com\/#languages-list\">PrismJS Language List<\/a><\/p><\/dd>\n<dt>Which languages are included by default?<\/dt>\n<dd><ul>\n<li>Markup<\/li>\n<li>CSS<\/li>\n<li>C Languages<\/li>\n<li>JavaScript<\/li>\n<li>Apache Configuration<\/li>\n<li>Bash<\/li>\n<li>Batch<\/li>\n<li>Ruby<\/li>\n<li>Docker<\/li>\n<li>Git<\/li>\n<li>HTML<\/li>\n<li>HTTP<\/li>\n<li>Makefile<\/li>\n<li>Markdown<\/li>\n<li>Nginx Config<\/li>\n<li>PHP<\/li>\n<li>Python<\/li>\n<li>SASS and SCSS<\/li>\n<li>SQL<\/li>\n<\/ul><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.1<\/h4>\n\n<ul>\n<li>Tested with current version of WP, updated readme.txt<\/li>\n<\/ul>\n\n<h4>1.01<\/h4>\n\n<ul>\n<li>Updated readme.txt<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial Plugin Release<\/li>\n<\/ul>","raw_excerpt":"Codebocks Extended with PrismJS includes syntax highlighting, copy to clipboard, and Visual + Text editor integration.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/51684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=51684"}],"author":[{"embeddable":true,"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/duplaja"}],"wp:attachment":[{"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=51684"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=51684"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=51684"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=51684"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=51684"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/gd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=51684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}