{"id":74161,"date":"2018-01-14T16:37:46","date_gmt":"2018-01-14T16:37:46","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/wp-prism\/"},"modified":"2018-01-14T16:40:15","modified_gmt":"2018-01-14T16:40:15","slug":"wp-prism","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/wp-prism\/","author":39917,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.1","stable_tag":"trunk","tested":"","requires":"","requires_php":"","requires_plugins":"","header_name":"WP-Prism","header_author":"Mahmoud Al-Qudsi","header_description":"Translates fenced codeblocks (<code>```<\/code>) to prism","assets_banners_color":"","last_updated":"2018-01-14 16:40:15","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/neosmart.net\/blog\/2017\/wp-prism\/","header_author_uri":"https:\/\/neosmart.net\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1001,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[],"plugin_category":[],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-74161","plugin","type-plugin","status-publish","hentry","plugin_committers-computerguru"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-prism.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>wp-prism brings GitHub-styled code-fencing and prism-powered syntax highlighting to your WordPress installation, written from scratch to be as freaky fast as possible.<\/p>\n\n<p>wp-prism currently supports syntax highlighting for 41 languages and <em>only loads the JavaScript and CSS to highlight your syntax when needed.<\/em><\/p>\n\n<p>You can say goodbye to page bloat and long load times, because it makes no sense to do this any other way.<\/p>\n\n<h3>What it does<\/h3>\n\n<p>wp-prism does exactly what it says on the box: it takes a code-fenced block of source code nested in your WordPress pages and posts, like this:<\/p>\n\n<pre><code>    `rust\nfn main() {\n    println!(\"Hello, world!\");\n}\n    `\n<\/code><\/pre>\n\n<p>And turns into a syntax-highlighted work of art, like this:<\/p>\n\n<pre><code>`rust\n<\/code><\/pre>\n\n<p>fn main() {\n    println!(\"Hello, world!\");\n}\n    <code>&lt;h3&gt;How to install&lt;\/h3&gt;\nJust grab a copy of<\/code>wp-prism` from the WordPress plugins repository or clone our github repo from <a href=\"https:\/\/github.com\/neosmart\/wp-prism\">https:\/\/github.com\/neosmart\/wp-prism<\/a>.<\/p>\n\n<p>There is no configuration needed.<\/p>\n\n<h3>Avoiding whitespace mangling<\/h3>\n\n<p>WordPress (well, TinyMCE) loves to mangle whitespace in posts. As such, wp-prism supports (and recommends) embedding your code fragments in <code>&lt;pre&gt;<\/code> tags if you're going to use the visual editor (or will use the visual editor at any point). wp-prism detects the outer <code>&lt;pre&gt;<\/code> and takes care not to emit a second <code>&lt;pre&gt;<\/code> tag in such cases.<\/p>\n\n<p>To illustrate with an example:<\/p>\n\n<pre><code>&lt;pre&gt;\n    `cpp\nvoid Greet(const char *name)\n{\n    printf(\"Hello %s!\\n\", name);\n}\n    `\n&lt;\/pre&gt;\n\n`cpp\n<\/code><\/pre>\n\n<p>void Greet(const char *name)\n{\n    printf(\"Hello %s!\\n\", name);\n}\n    `<\/p>","raw_excerpt":"wp-prism brings GitHub-styled code-fencing and prism-powered syntax highlighting to your WordPress installation, written from scratch to be as freaky  &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/74161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=74161"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/computerguru"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=74161"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=74161"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=74161"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=74161"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=74161"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=74161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}