{"id":18733641,"url":"https://github.com/pklaus/pygments-markdown-highlighter","last_synced_at":"2025-07-24T18:11:35.178Z","repository":{"id":66103780,"uuid":"1847068","full_name":"pklaus/pygments-markdown-highlighter","owner":"pklaus","description":"Pygments code highlighter for Markdown formatted posts in Wordpress","archived":false,"fork":false,"pushed_at":"2012-06-12T22:44:22.000Z","size":189,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T23:43:55.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://goo.gl/6OVlM","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pklaus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-06-04T15:18:07.000Z","updated_at":"2023-10-31T14:14:19.000Z","dependencies_parsed_at":"2023-02-19T22:35:17.603Z","dependency_job_id":null,"html_url":"https://github.com/pklaus/pygments-markdown-highlighter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pklaus/pygments-markdown-highlighter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pklaus%2Fpygments-markdown-highlighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pklaus%2Fpygments-markdown-highlighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pklaus%2Fpygments-markdown-highlighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pklaus%2Fpygments-markdown-highlighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pklaus","download_url":"https://codeload.github.com/pklaus/pygments-markdown-highlighter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pklaus%2Fpygments-markdown-highlighter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266885837,"owners_count":24000995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T15:10:45.039Z","updated_at":"2025-07-24T18:11:35.154Z","avatar_url":"https://github.com/pklaus.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Pygments highlighter for code blocks in Wordpress posts written with Markdown Syntax\n\npygments-markdown-highlighter is a plugin for [WordPress][] to highlight code blocks using the syntax highlighter [Pygments]. This enables you to have code highlighting for your Markdown code blocks while writing your whole blog posts using [Markdown][]. You can specify the language of the code block in its first line.\n\n### Installation\n\nFirst install Pygments on the system. On a Debian/Ubuntu web server this would be the package [python-pygments](http://packages.debian.org/squeeze/python-pygments):\n\n    ssh user@yourblog\n    su\n    apt-get update\n    apt-get install python-pygments\n\nI don't now how to install Pygments if you don't have administrative permissions on your server. If you do, please contact me so that I can update these instructions.\n\nThen install the plugin itself. Again, we connect via ssh and download the plugin to the WordPress plugins folder using git. This way the plugin will be a git repository and can be updated easily using `git pull`:\n\n    ssh user@yourblog\n    cd /your/blog/folder/wp-content/plugins\n    git clone git://github.com/pklaus/pygments-markdown-highlighter.git\n\nIf you don't have access to neither ssh nor git, you may still be able to upload the plugin to your server via *Add Plugin* → *Upload*.\n\nFinally activate the plugin on the plugin overview page of your WordPress blog.\n\n### Configuration\n\nThere is a configuration page for the plugin. It's named 'Pygments Markdown Highlighter' and can be found in the settings section on the admin area of your WordPress blog.\n\nYou can configure if you want the line numbers to be displayed inline with the code (bad for copy'n'paste or using a table.\nIn addition you can set the colour scheme for the highlighted code and a custom path to your Pygments binary.\n\n### Usage\n\nTo highlight code in your posts, add a shebang styled first line `#!lexername` to your code. Replace `lexername` with the lexer keyword for the language that you want to be highlighted as shown in the [List of Pygments Lexers][].\n\nAn example for code that will be highlighted as Python source code on your blog (the first line will not be shown):\n\n        #!python\n        import platform\n        print \"This is Python %s.\" % platform.python_version()\n\n### Upgrading\n\nIf you want to upgrade, a simple `git pull` in the plugin directory should be enough.\n\nThe first version of this plugin by Stephen H. Gerstacker used a different notation: `    :::lexername`. To convert posts from the old notation to the shebang style notation you can use the following SQL commands:\n\n1. Search affected posts:  \n   `SELECT post_content FROM wp_posts WHERE post_content LIKE \"%\\n    :::%\";`\n2. Updated affected posts:\n   `UPDATE wp_posts SET post_content = REPLACE(post_content, \"\\n    :::\",\"\\n    #!\");`\n\n### Alternatives\n\n* There is another WordPress plugin called **wp-markdown-syntax-highlight**\n  \u003chttps://github.com/spjwebster/wp-markdown-syntax-highlight\u003e.\n  It includes the PHP-based GeSHi code highlighter and you can highlight\n  Markdown code blocks with an language indicator like a shebang: `#!python`.\n* Write regular Markdown code blocks and use\n  **[highlight.js](http://softwaremaniacs.org/soft/highlight/en/)**,\n  (a pure-javascript syntax highlighter that automatically detects the\n  language of code blocks). You may install this script manually or try\n  out the WordPress plugin \u003chttp://lpriori.org/highlightjs/\u003e.  \n* As you can put regular HTML in your Markdown text, you may just put\n  a `\u003ccode\u003e` block in your text.\n  This way you can **rely on any other source code markup plugin** to\n  markup your code.\n\n### Copyright and License\n\nCopyright (c) 2011 Stephen H. Gerstacker, Philipp Klaus\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n### Author\n\n* Stephen H. Gerstacker – The original author of this plugin\n  * Homepage: \u003chttp://shortround.net/\u003e\n  * Source Code: \u003chttps://github.com/stack/pygments-markdown-highlighter\u003e\n\n* Philipp Klaus – Contributions to the documentation and the plugin.\n  * Blog post on pygments-markdown-highlighter: \u003chttp://wp.me/p1fyOX-ZJ\u003e\n  * Source Code: \u003chttps://github.com/pklaus/pygments-markdown-highlighter\u003e\n  * E-Mail: philipp.klaus →AT→ gmail.com\n\n[WordPress]: http://wordpress.org/\n[Pygments]: http://pygments.org\n[List of Pygments Lexers]: http://pygments.org/docs/lexers/\n[Markdown]: http://daringfireball.net/projects/markdown/\n[Markdown Syntax]: http://daringfireball.net/projects/markdown/syntax\n[PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpklaus%2Fpygments-markdown-highlighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpklaus%2Fpygments-markdown-highlighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpklaus%2Fpygments-markdown-highlighter/lists"}