{"id":24116,"date":"2015-05-15T11:11:07","date_gmt":"2015-05-15T09:11:07","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=24116"},"modified":"2015-05-15T11:11:07","modified_gmt":"2015-05-15T09:11:07","slug":"github-markdown-syntax-highlighting","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2015\/05\/15\/github-markdown-syntax-highlighting\/","title":{"rendered":"GitHub markdown syntax highlighting"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>Somehow, I missed this and haven&#8217;t used it until yesterday &#8211; <a href=\"https:\/\/help.github.com\/articles\/github-flavored-markdown\/#syntax-highlighting\">GitHub markdown syntax highlighting<\/a>:<\/p>\n<blockquote><p>Code blocks can be taken a step further by adding syntax highlighting. In your fenced block, add an optional language identifier and we&#8217;ll run it through syntax highlighting. For example, to syntax highlight Ruby code:<\/p>\n<pre><code>```ruby\r\nrequire 'redcarpet'\r\nmarkdown = Redcarpet.new(\"Hello World!\")\r\nputs markdown.to_html\r\n```\r\n<\/code><\/pre>\n<p>We use <a href=\"https:\/\/github.com\/github\/linguist\">Linguist<\/a> to perform language detection and syntax highlighting. You can find out which keywords are valid by perusing <a href=\"https:\/\/github.com\/github\/linguist\/blob\/master\/lib\/linguist\/languages.yml\">the languages YAML file<\/a>.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>Somehow, I missed this and haven&#8217;t used it until yesterday &#8211; GitHub markdown syntax highlighting: Code blocks can be taken a step further by adding syntax highlighting. In your fenced block, add an optional language identifier and we&#8217;ll run it through syntax highlighting. For example, to syntax highlight Ruby code: &#8220;`ruby require &#8216;redcarpet&#8217; markdown = &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2015\/05\/15\/github-markdown-syntax-highlighting\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">GitHub markdown syntax highlighting<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"GitHub markdown syntax highlighting #GitHub #WebDev","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,62,1334],"tags":[2809,1330],"keyring_services":[],"class_list":["post-24116","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-technology","category-web-work","tag-github","tag-web-development"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":27355,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/02\/18\/wordpress-vim-vim-plugin-for-wordpress-development\/","url_meta":{"origin":24116,"position":0},"title":"WordPress.vim &#8211; Vim Plugin for WordPress Development","author":"Leonid Mamchenkov","date":"February 18, 2017","format":false,"excerpt":"If Vim is your editor of choice, and WordPress is something you work with on a regular basis, then check out WordPress.vim - a Vim plugin for WordPress development. Some of the features are: Auto-Completion for the WordPress API WordPress Hooks Integration WP-CLI Integration Jump to Definition in WordPress Core\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2017\/02\/wordpress-500x243.gif?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":37916,"url":"https:\/\/mamchenkov.net\/wordpress\/2019\/03\/11\/markdeep-markdown-on-steroids\/","url_meta":{"origin":24116,"position":1},"title":"Markdeep &#8211; Markdown on steroids","author":"Leonid Mamchenkov","date":"March 11, 2019","format":false,"excerpt":"Markdown is of the best formats for writing documentation. It's intuitive, cross-platform, and can be read or written without any special tools. But it does have a variety of limitations too (no includes, no special formatting for advanced things like charts or formulas, etc). Markdeep is one of the tools\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/03\/markdeep.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/03\/markdeep.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2019\/03\/markdeep.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":16619,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/08\/12\/octopress-a-blogging-framework-for-hackers\/","url_meta":{"origin":24116,"position":2},"title":"Octopress &#8211; a blogging framework for hackers","author":"Leonid Mamchenkov","date":"August 12, 2012","format":"link","excerpt":"Octopress - a blogging framework for hackers Being a very happy WordPress user doesn't stop me from looking around for alternatives. \u00a0I recently came across Octopress, which is, in some sort, GitHub pages on steroids. \u00a0This is a really neat and geeky approach to tech-savvy bloggers. Recently, version 2.0 has\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27628,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/05\/28\/using-vim-as-a-php-ide\/","url_meta":{"origin":24116,"position":3},"title":"Using Vim as a PHP IDE","author":"Leonid Mamchenkov","date":"May 28, 2017","format":false,"excerpt":"Jon Cairns wrote \"Using Vim as a PHP IDE\" blog post a good five years ago, but a lot of it still relevant and useful. It covers all the usual - syntax highlighting, syntax checking\/linting, tags and auto-completion, coding style and mess detecting, unit testing and debugging. As many other\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28827,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/09\/30\/highlights-from-git-2-19-and-php-syntax\/","url_meta":{"origin":24116,"position":4},"title":"Highlights from Git 2.19 and PHP syntax","author":"Leonid Mamchenkov","date":"September 30, 2018","format":false,"excerpt":"GitHub blog covers the highlights from Git 2.19, which was recently released. One particular change that I want to highlight (which GitHub skipped in their highlights, but which exists in the Git release notes for this version) is the syntax pattern update for the PHP files. Let's have a look\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/09\/git-range-diff-500x243.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":28909,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/11\/04\/mycli-mysql-command-line-client-with-auto-completion\/","url_meta":{"origin":24116,"position":5},"title":"mycli &#8211; MySQL command line client with auto-completion","author":"Leonid Mamchenkov","date":"November 4, 2018","format":false,"excerpt":"mycli is a MySQL \/ MariaDB \/ Pecona database command line client with syntax highlighting and auto-completion.\u00a0 Have a look at some of the screenshots and documentation for features. Found via this StackOverflow discussion.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2018\/11\/mycli-500x181.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/24116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=24116"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/24116\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=24116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=24116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=24116"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=24116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}