{"id":32923,"date":"2014-11-19T10:21:23","date_gmt":"2014-11-19T10:21:23","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/pcsh-pastacode-syntaxhighlighter\/"},"modified":"2015-12-10T13:11:30","modified_gmt":"2015-12-10T13:11:30","slug":"pcsh-pastacode-syntaxhighlighter","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/pcsh-pastacode-syntaxhighlighter\/","author":13898652,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.4.2","stable_tag":"0.4.2","tested":"4.4.34","requires":"3.1","requires_php":"","requires_plugins":"","header_name":"PCSH","header_author":"Yury Pavlov","header_description":"","assets_banners_color":"","last_updated":"2015-12-10 13:11:30","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/Webaib\/PastacodeAndSyntaxHighlighter","header_author_uri":"http:\/\/www.overscale.net","rating":3,"author_block_rating":0,"active_installs":10,"downloads":2528,"num_ratings":2,"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":0,"4":0,"5":"1"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.2","0.3","0.4","0.4.1","0.4.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1028508","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1028508","resolution":"2","location":"assets"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1028508","resolution":"3","location":"assets"},"screenshot-4.png":{"filename":"screenshot-4.png","revision":"1028508","resolution":"4","location":"assets"},"screenshot-5.png":{"filename":"screenshot-5.png","revision":"1028508","resolution":"5","location":"assets"},"screenshot-6.png":{"filename":"screenshot-6.png","revision":"1028508","resolution":"6","location":"assets"},"screenshot-7.png":{"filename":"screenshot-7.png","revision":"1028508","resolution":"7","location":"assets"},"screenshot-8.png":{"filename":"screenshot-8.png","revision":"1028508","resolution":"8","location":"assets"},"screenshot-9.png":{"filename":"screenshot-9.png","revision":"1028508","resolution":"9","location":"assets"}},"screenshots":{"1":"View of the PCSH code lightbox","2":"Default color scheme","3":"<em>Django<\/em> color scheme","4":"<em>Eclipse<\/em> color scheme","5":"<em>Emacs<\/em> color scheme","6":"<em>FadeToGrey<\/em> color scheme","7":"<em>MDUltra<\/em> color scheme","8":"<em>Midnight<\/em> color scheme","9":"<em>RDark<\/em> color scheme"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1667,1214,230,1673,9150],"plugin_category":[56],"plugin_contributors":[92093],"plugin_business_model":[],"class_list":["post-32923","plugin","type-plugin","status-publish","hentry","plugin_tags-bitbucket","plugin_tags-code","plugin_tags-embed","plugin_tags-github","plugin_tags-version","plugin_category-social-and-sharing","plugin_contributors-webaib","plugin_committers-webaib"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/pcsh-pastacode-syntaxhighlighter.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/pcsh-pastacode-syntaxhighlighter\/assets\/screenshot-1.png?rev=1028508","caption":"View of the PCSH code lightbox"},{"src":"https:\/\/ps.w.org\/pcsh-pastacode-syntaxhighlighter\/assets\/screenshot-2.png?rev=1028508","caption":"Default color scheme"},{"src":"https:\/\/ps.w.org\/pcsh-pastacode-syntaxhighlighter\/assets\/screenshot-3.png?rev=1028508","caption":"<em>Django<\/em> color scheme"},{"src":"https:\/\/ps.w.org\/pcsh-pastacode-syntaxhighlighter\/assets\/screenshot-4.png?rev=1028508","caption":"<em>Eclipse<\/em> color scheme"},{"src":"https:\/\/ps.w.org\/pcsh-pastacode-syntaxhighlighter\/assets\/screenshot-5.png?rev=1028508","caption":"<em>Emacs<\/em> color scheme"},{"src":"https:\/\/ps.w.org\/pcsh-pastacode-syntaxhighlighter\/assets\/screenshot-6.png?rev=1028508","caption":"<em>FadeToGrey<\/em> color scheme"},{"src":"https:\/\/ps.w.org\/pcsh-pastacode-syntaxhighlighter\/assets\/screenshot-7.png?rev=1028508","caption":"<em>MDUltra<\/em> color scheme"},{"src":"https:\/\/ps.w.org\/pcsh-pastacode-syntaxhighlighter\/assets\/screenshot-8.png?rev=1028508","caption":"<em>Midnight<\/em> color scheme"},{"src":"https:\/\/ps.w.org\/pcsh-pastacode-syntaxhighlighter\/assets\/screenshot-9.png?rev=1028508","caption":"<em>RDark<\/em> color scheme"}],"raw_content":"<!--section=description-->\n<p>With PCSH (based on the Pastacode plugin), you can easily add code into your posts with the awesome SyntaxHighlighter js-library.\nYou can insert source code into the post editor, from a file, or from webservices like GitHub, Gist, Pastebin or BitBucket. Webservices responses are cached in order to avoid too many HTTP requests.<\/p>\n\n<p>Don't worry about posts updates while upgrading codes!<\/p>\n\n<p>PCSH allows to enhance your snippets using SyntaxHighlighter plugins (highlightning lines, link functions...).<\/p>\n\n<p>8 different color schemes are included, and you can build yours.<\/p>\n\n<p>Available programming languages:<\/p>\n\n<ul>\n<li>AppleScript<\/li>\n<li>ActionScript3<\/li>\n<li>Bash<\/li>\n<li>CoffeeScript<\/li>\n<li>C++<\/li>\n<li>C#<\/li>\n<li>CSS<\/li>\n<li>Pascal<\/li>\n<li>Diff<\/li>\n<li>Erlang<\/li>\n<li>Groovy<\/li>\n<li>Haxe<\/li>\n<li>Java<\/li>\n<li>JavaFX<\/li>\n<li>JavaScript<\/li>\n<li>Perl<\/li>\n<li>PHP<\/li>\n<li>Plain<\/li>\n<li>Python<\/li>\n<li>Ruby<\/li>\n<li>Scala<\/li>\n<li>SQL<\/li>\n<li>VisualBasic<\/li>\n<li>XML<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Unzip PCSH into your plugin folder<\/li>\n<li>Go to PCSH settings, and configure your color scheme and cache expiration<\/li>\n<li>Host your snippets on repositories (or localy)<\/li>\n<li>Editing a post, use <em>PCSH<\/em> button to embed your source code into articles<\/li>\n<\/ol>\n\n<h4>Ajax compatibility<\/h4>\n\n<p>To enable PCSH on ajax based websites, it need two steps :<\/p>\n\n<ol>\n<li>Paste this line into your functions.php theme file : \"add_filter( 'pcsh_ajax', '__return_true' );\"<\/li>\n<li>After each change on your DOM, you will have to run this javascript function : \"SyntaxHighlighter.all();\"<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>How to setup a custom cache expiration ?<\/dt>\n<dd><p>Paste these lines into your functions.php theme file :\n\"add_filter( 'option_pcsh_cache_duration', 'my_pcsh_cache_duration' );\nfunction my_pcsh_cache_duration( $duration ) {\n    $duration = DAY_IN_SECOND*3; \/\/ 3 days\n    return $duration;\n}\"<\/p><\/dd>\n<dt>How define a custom color scheme ?<\/dt>\n<dd><p>Paste these lines into your functions.php theme file :\n\"add_filter( 'option_pcsh_style', 'my_pcsh_style' );\nfunction my_pcsh_style( $scheme ) {\n    $scheme = 'my_awesome_style'; \/\/CSS filename into the plugin css directory\n    return $scheme;\n}\"<\/p><\/dd>\n<dt>How to filter supported languages ?<\/dt>\n<dd><p>Paste these lines into your functions.php theme file :\n\"\/\/If you just want php, html, css and javascript support\nadd_filter( 'pcsh_langs', '_pcsh_langs' );\nfunction _pcsh_langs( $langs ) {\n    $langs  = array(\n        'php'          =&gt; 'PHP',\n        'markup'       =&gt; 'HTML',\n        'css'          =&gt; 'CSS',\n        'javascript'   =&gt; 'JavaScript'\n    );<\/p>\n\n<pre><code>return $langs;\n<\/code><\/pre>\n\n<p>}\"<\/p><\/dd>\n<dt>How to add a new provider ?<\/dt>\n<dd><p>Paste these lines into your functions.php theme file :\n\"\/\/Take WordPress SVN, for example\n\/\/register a provider\nadd_filter( 'pcsh_services', '_pcsh_services' );\nfunction _pcsh_services( $services ) {\n    $services['wordpress'] = 'core.svn.wordpress.org';\n    return $services;\n}<\/p>\n\n<p>\/\/Define pastabox lightbox inputs\nadd_action( 'pcsh_fields', '_pcsh_fields' );\nfunction _pcsh_fields( $fields ) { \n    $fields['wordpress'] = array(  \/\/ 'wordpress' or 'whatever'\n        'classes'     =&gt; array( 'wordpress' ), \/\/ same value as the key\n        'label'       =&gt; sprintf( __('File path relative to %s', 'pcsh'), 'http:\/\/core.svn.wordpress.org\/' ), \n        'placeholder' =&gt;'trunk\/wp-config-sample.php', \/\/if placeholder isn't defined, it will be a textarea\n        'name'        =&gt; 'path_id' \/\/these value return shortcode attribute (path_id, repos, name, user, version)\n        );\n    return $fields;\n}<\/p>\n\n<p>\/\/Build the function to retrieve the code\n\/\/ \"pcsh_wordpress\" hook name (1st param) = \"pcsh_\" + \"wordpress\" or \"whatever\"\nadd_action( 'pcsh_wordpress', '_pcsh_wordpress', 10, 2 );\nfunction _pcsh_wordpress( $source, $atts ) {\n    extract( $atts );\n    if( $path_id ) {\n        $req  = wp_sprintf( 'http:\/\/core.svn.wordpress.org\/%s', str_replace( 'http:\/\/core.svn.wordpress.org\/', '', $path_id ) );\n        $code = wp_remote_get( $req );\n        if( ! is_wp_error( $code ) &amp;&amp; 200 == wp_remote_retrieve_response_code( $code ) ) {\n            $data = wp_remote_retrieve_body( $code );\n            $source[ 'url' ]  = $req; \/\/url to view source\n            $source[ 'name' ] = basename( $req ); \/\/filename\n            $source[ 'code' ] = esc_html( $data ); \/\/the code !!<br \/>\n            \/\/$source[ 'raw' ] contain raw source code. But there are no raw source code delivered by Wordpress SVN<br \/>\n        }\n    }\n    return $source;\n}\"<\/p>\n\n<p>Do not add you root website!! A contributor can add the shortcode to point your \"wp-config.php\" to read it!!<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.4.2<\/h4>\n\n<ul>\n<li>10 December 2015<\/li>\n<li>Checked for Compatibility with WP 4.4 <\/li>\n<\/ul>\n\n<h4>0.4.1<\/h4>\n\n<ul>\n<li>19 August 2015<\/li>\n<li>Checked for Compatibility with WP 4.3 <\/li>\n<\/ul>\n\n<h4>0.4<\/h4>\n\n<ul>\n<li>29 April 2015<\/li>\n<li>Checked for Compatibility with WP 4.2.1<\/li>\n<li>Add a linehighlighting for a range of lines (e.g. 3-7) <\/li>\n<\/ul>\n\n<h4>0.3<\/h4>\n\n<ul>\n<li>2x December 2015<\/li>\n<li>Minor update in the plugin description<\/li>\n<\/ul>\n\n<h4>0.2<\/h4>\n\n<ul>\n<li>20 November 2014<\/li>\n<li>Add russian translation<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>19 November 2014<\/li>\n<li>Prism replaced by SyntaxHighlighter<\/li>\n<li>Renamed all settings, functions and co. to eliminate any conflicts with the original plugin.  <\/li>\n<\/ul>\n\n<h4>1.3*<\/h4>\n\n<ul>\n<li>5 may 2014<\/li>\n<li>TinyMCE Editor support improvment (visual placeholder on editor mode, new tinyMCE button...)<\/li>\n<li>Github API restriction fallback (support now more than 30 requests \/ hour)<\/li>\n<li>New ajax compatibility (using hook pcsh_ajax)<\/li>\n<li>Fix bug: No more disgracefull linebreaks on code view.<\/li>\n<\/ul>\n\n<h4>1.2.1*<\/h4>\n\n<ul>\n<li>21 nov 2013<\/li>\n<li>Fix bug: when manual provider is selected, no cache.<\/li>\n<\/ul>\n\n<h4>1.2*<\/h4>\n\n<ul>\n<li>15 oct 2013<\/li>\n<li>The modification of the cache duration do not purge cache anymore<\/li>\n<li>New button \"Purge Cache\" in option page, use it to delete all transients (they contains the responded source codes)<\/li>\n<li>Fix bug when updating option<\/li>\n<\/ul>\n\n<h4>1.1*<\/h4>\n\n<ul>\n<li>12 oct 2013<\/li>\n<li>Hooks, hooks and hooks.<\/li>\n<li>Update shortcode format (\"type\" became \"provider\", and add \"\/\" before the closing tag)<\/li>\n<\/ul>\n\n<h4>1.0*<\/h4>\n\n<ul>\n<li>10 oct 2013<\/li>\n<li>Initial release<\/li>\n<li>Insert codes using a nice lightbox<\/li>\n<li>Import codes from file, Github, Gist, Pastebin or BitBucket<\/li>\n<li>13 languages available<\/li>\n<li>6 color schemes<\/li>\n<li>Cache support for webservices (default duration : 1 week)<\/li>\n<\/ul>","raw_excerpt":"Use PCSH to add code into your posts with the awesome SyntaxHighlighter plugin. So, past&#039;a code!","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/32923","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=32923"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/webaib"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=32923"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=32923"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=32923"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=32923"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=32923"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=32923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}