{"id":207612,"date":"2010-11-22T08:00:00","date_gmt":"2010-11-22T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/wp-geshi-highlight\/"},"modified":"2023-04-30T16:39:00","modified_gmt":"2023-04-30T16:39:00","slug":"wp-geshi-highlight","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/wp-geshi-highlight\/","title":{"rendered":"WP-GeSHi-Highlight \u2014 rock-solid syntax highlighting for 259 languages"},"content":{"rendered":"<p><strong>\u2022 <a href=\"https:\/\/gehrcke.de\/wp-geshi-highlight-demo\/\" rel=\"nofollow ugc\">Live demo<\/a><\/strong><\/p>\n<p><strong>\u2022 Highlights:<\/strong><\/p>\n<ul>\n<li>Supports <a href=\"https:\/\/github.com\/GeSHi\/geshi-1.0\/tree\/v1.0.9.1\/src\/geshi\" rel=\"nofollow ugc\">259 languages<\/a>.<\/li>\n<li>Server-side. Saves bandwidth, latency, and battery compared to client-side rendering.<\/li>\n<li>Near-zero load on the backend. With a caching solution this does not affect your page load time at all.<\/li>\n<li>Line numbering. If you want to (no vertical displacements between code line and line number).<\/li>\n<li>Default style was tested with more than 20 themes, including Twenty Ten to Fifteen, and tweaked based on a bunch of user feedback.<\/li>\n<li>If you\u2019d like to tweak the style: just provide your own CSS file. Styles are highly & easily configurable.<\/li>\n<li>Per-block styles: each code block on a single page can be styled on its own (if that is something you would liked to do).<\/li>\n<li>Clean, small and valid HTML output.<\/li>\n<li>Well-documented source code using modern WordPress API calls.<\/li>\n<li>I have maintained this plugin for several years and I plan to continue to provide support.<\/li>\n<li>Based on <a href=\"http:\/\/qbnz.com\/highlighter\/\" rel=\"nofollow ugc\">GeSHi<\/a>, a reliable and well-established PHP highlighting engine, used by popular community forum applications such as phpBB or wiki applications such as Dokuwiki or MediaWiki.<\/li>\n<\/ul>\n<p>WP-GeSHi-Highlight works as a drop-in replacement for <a href=\"https:\/\/wordpress.org\/extend\/plugins\/wp-syntax\/\" rel=\"ugc\">WP-Syntax<\/a>, which does not seem to be maintained anymore (as of 2015). Make the switch, it should just work (let me know how it went)!<\/p>\n<p><strong>\u2022 Usage:<\/strong><\/p>\n<p>WordPress 5 users: for now I have tested this plugin only with the <a href=\"https:\/\/wordpress.org\/plugins\/classic-editor\/\" rel=\"ugc\">Classical Editor<\/a>. Gutenberg is not yet supported (it may work though, let me know).<\/p>\n<p>Recommendation: <em>use the \u201cText\u201d (raw) editor<\/em>. Do not use the \u201cVisual\u201d editor. Switching between both may corrupt the contents of your code blocks.<\/p>\n<p>In the text editor insert code blocks as <code>pre<\/code> blocks, and use the <code>lang<\/code> argument to define the language of the code snippet:<\/p>\n<pre><code><pre lang=\"language\">\n    CODE\n<\/pre>\n<p><\/code><\/p>\n<p>A short example for the <code>bash<\/code> language:<\/p>\n<pre><code><pre lang=\"bash\">\n    $ dd if=\/dev\/zero of=image.ext3 bs=1M count=10000 oflag=append conv=notrunc\n<\/pre>\n<p><\/code><\/p>\n<p>Publish\/preview, and have a look at the result!<\/p>\n<p>Also check out the reference documentation for all available options. You can find it on the <a href=\"https:\/\/gehrcke.de\/wp-geshi-highlight\" rel=\"nofollow ugc\">plugin\u2019s website<\/a>. Note that more usage examples can be found on the <a href=\"https:\/\/gehrcke.de\/wp-geshi-highlight-demo\/\" rel=\"nofollow ugc\">demo website<\/a>.<\/p>\n<p><strong>\u2022 Issues:<\/strong><\/p>\n<p>A bunch of websites have used this plugin for years, and it seems to serve its purpose well. If you find an issue please let me know: drop a <a href=\"mailto:jgehrcke@googlemail.com\" rel=\"nofollow ugc\">mail<\/a> or leave a <a href=\"http:\/\/gehrcke.de\/wp-geshi-highlight\" rel=\"nofollow ugc\">comment<\/a>.<\/p>\n<p><strong>\u2022 Theme compatibility of the default style sheet:<\/strong><\/p>\n<p>The default style sheet was tested with recent versions of all official themes (Twenty Ten to Twenty Fifteen), and with a large range of non-official themes such as Vantage, Customizr, ColorWay, Zerif Lite, Responsive, Storefront, Virtue, evolve, Make, Sparkling, Spacious, Enigma, Sydney, Point, Interface, SinglePage.<\/p>\n<p>Certain themes might define styles with a high specificity that negatively affect the visual code block appearance. It is difficult to impossible to anticipate all these cases in advance, so I expect this to happen in rare cases (the past has proven that these things happen). So, I need you to look out for these situations, and please report them!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Simple. Fast. 259 languages. Mobile-friendly. Rock-solid (GeSHi).<\/p>\n","protected":false},"author":65,"featured_media":381810,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"WP-GeSHi-Highlight \u2014 rock-solid syntax highlighting for 259 languages - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"Simple. Fast. 259 languages. Mobile-friendly. Rock-solid (GeSHi)."},"footnotes":""},"categories":[1],"tags":[1282,8670,5095,8671,1283],"class_list":["post-207612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-code","tag-geshi","tag-highlight","tag-highlighting","tag-syntax"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/207612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=207612"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/207612\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/381810"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=207612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=207612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=207612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}