=== My Syntax Highlighter === Contributors: Arthur Gareginyan Tags: code, php, html ,css, javascript, snippet, codemirror, hightlight, syntax highlighting, syntaxhighlighting, syntax highlighter, syntaxhighlighter, syntax, Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8A88KC7TFF6CS Requires at least: 3.9 Tested up to: 4.7 Stable tag: 2.1 License: GPL3 License URI: http://www.gnu.org/licenses/gpl-3.0.html Simple post syntax-highlighted code without losing it's formatting or making any manual changes. Supporting multiple languages, shortcodes and themes. == Description == An easy to use, with intuitive interface WordPress plugin that provides a simple way for embedding syntax-highlighted source code within pages or posts on your website, without losing it's formatting or making any manual changes. Supporting 14 languages, 16 shortcodes and 36 themes. The syntax highlighting feature implemented via a [CodeMirror](https://codemirror.net/) library. If you want more options then tell me and I will be happy to add it. Syntax highlighting is a feature that displays source code, in different colors and fonts according to the category of terms. Syntax highlighting is one strategy to improve the readability and context of the text; especially for code that spans several pages. The reader can easily ignore large sections of comments or code, depending on what they are looking for. This plugin also uses standalone Shortcode-Processor to prevent WordPress from converting newlines to HTML paragraphs, replacing apostrophes with typographic quotes and so on. This plugin is just plug and play, no tedious configurations or hacks, just install, enable and start using your new shortcodes. = Features = * Lightweight and fast * Secure code with using clear coding standards * Intuitive interface with many settings * Cross browser compatible (work smooth in any modern browser) * Compatible with all WordPress themes * RTL compatible (right to left) * Translation ready **Key features include...** * Standalone Shortcode-Processor * Syntax highlighting (by CodeMirror) * Line numbering * 36 Themes * 14 Languages * 16 Shortcodes * Allow shortcodes in the text widget * And much, much more! **A list of supported languages:** Click to view language examples. Highlighted with Default theme. * [PHP](http://codemirror.net/mode/php/index.html) * [JavaScript](http://codemirror.net/mode/javascript/index.html) * [XML](http://codemirror.net/mode/xml/index.html) * [HTML](http://codemirror.net/mode/htmlmixed/index.html) * [CSS](http://codemirror.net/mode/css/index.html) * [SCSS](http://codemirror.net/mode/css/scss.html) * [LESS](http://codemirror.net/mode/css/less.html) * [SASS](http://codemirror.net/mode/sass/index.html) * [MarkDown](http://codemirror.net/mode/markdown/index.html) * [Perl](http://codemirror.net/mode/perl/index.html) * [SQL](http://codemirror.net/mode/sql/index.html) * [MySQL](http://codemirror.net/mode/sql/index.html) * [Shell](http://codemirror.net/mode/shell/index.html) * [BASH](http://codemirror.net/mode/shell/index.html) **A list of supported shortcodes:** * [code][/code] * [php][/php] * [javascript][/javascript] * [js][/js] * [xml][/xml] * [html][/html] * [css][/css] * [scss][/scss] * [less][/less] * [sass][/sass] * [markdown][/markdown] * [perl][/perl] * [sql][/sql] * [mysql][/mysql] * [shell][/shell] * [bash][/bash] **A list of supported themes:** * 3024-day * 3024-night * ambiance-mobile * ambiance * base16-dark * base16-light * blackboard * cobalt * colorforth * eclipse * elegant * erlang-dark * lesser-dark * liquibyte * mbo * mdn-like * midnight * monokai * neat * neo * night * paraiso-dark * paraiso-light * pastel-on-dark * rubyblue * solarized * the-matrix * tomorrow-night-bright * tomorrow-night-eighties * ttcn * twilight * vibrant-ink * xq-dark * xq-light * zenburn = Translation = * English (default) * Russian If you would like to add a translation to this plugin then please head to our [Translating WordPress](https://translate.wordpress.org/projects/wp-plugins/my-syntax-highlighter) page. >**Contribution** > >Developing plugins is long and tedious work. If you benefit or enjoy this plugin please take the time to: > >* [Donate](http://www.arthurgareginyan.com/donate.html) to support ongoing development. Your contribution would be greatly appreciated. >* [Rate and Review](https://wordpress.org/support/view/plugin-reviews/my-syntax-highlighter?rate=5#postform) this plugin. >* [Share with me](mailto:arthurgareginyan@gmail.com) or view the [GitHub Repo](https://github.com/ArthurGareginyan/my-syntax-highlighter) if you have any ideas or suggestions to make this plugin better. == Installation == Install "My Syntax Highlighter" just as you would any other WordPress Plugin. Automatically via WordPress Admin area: 1. Log into Admin area of your WordPress website. 2. Go to "`Plugins`" -> "`Add New`". 3. Find this plugin and click install. 4. Activate this plugin through the "`Plugins`" tab. Manually via FTP access: 1. Download a copy (ZIP file) of this plugin from WordPress.org. 2. Unzip the ZIP file. 3. Upload the unzipped catalog to your website's plugin directory (`/wp-content/plugins/`). 4. Log into Admin area of your WordPress website. 5. Activate this plugin through the "`Plugins`" tab. After installation, a "`Syntax Highlighter`" menu item will appear in the "`Settings`" section. Click on this in order to view plugin's administration page. [More help installing Plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins "WordPress Codex: Installing Plugins") == Frequently Asked Questions == = Q. Will this plugin work on my WordPress.COM website? = A. Sorry, this plugin is available for use only on self-hosted (WordPress.ORG) websites. = Q. Can I use this plugin on my language? = A. Yes. But If your language is not available then you can make one. This plugin is ready for translation. The `.pot` file is included and placed in the "`languages`" folder. Many of plugin users would be delighted if you shared your translation with the community. Just send the translation files (`*.po, *.mo`) to me at the arthurgareginyan@gmail.com and I will include the translation within the next plugin update. = Q. How does it work? = A. Simply go to the plugin settings page, select the desired settings and click the "Save Changes" button. Enjoy the fancy syntax highlighting on your website. It's that simple! You can find the plugin settings page at "`WP Admin Panel`" -> "`Settings`" -> "`Syntax Highlighter`". = Q. Does this plugin requires any modification of the theme? = A. Absolutely not. This plugin is configurable entirely from the plugin settings page that you can find in the Admin Panel of your WordPress website. = Q. Does this require any knowledge of HTML or CSS? = A. Absolutely not. This plugin can be configured with no knowledge of HTML or CSS, using an easy-to-use plugin settings page. = Q. It's not working. What could be wrong? = A. As with every plugin, it's possible that things don't work. The most common reason for this is a web browser's cache. Every web browser stores a cache of the websites you visit (pages, images, and etc.) to reduce bandwidth usage and server load. This is called the browser's cache. Clearing your browser's cache may solve the problem. It's impossible to tell what could be wrong exactly, but if you post a support request in the plugin's support forum on WordPress.org, I'd be happy to give it a look and try to help out. Please include as much information as possible, including a link to your website where the problem can be seen. = Q. The last WordPress update is preventing me from editing my website that is using this plugin. Why is this? = A. This plugin can not cause such problem. More likely, the problem are related to the settings of the website. It could just be a cache, so please try to clear your website's cache (may be you using a caching plugin, or some web service such as the CloudFlare) and then the cache of your web browser. Also please try to re-login to the website, this too can help. = Q. Where to report bug if found? = A. Please visit the [Dedicated Plugin Page on GitHub](https://github.com/ArthurGareginyan/my-syntax-highlighter) and report. = Q. Where to share any ideas or suggestions to make the plugin better? = A. Any suggestions are very welcome! Please send me an email to [arthurgareginyan@gmail.com](mailto:arthurgareginyan@gmail.com). Thank you! = Q. I love this plugin! Can I help somehow? = A. Yes, any financial contributions are welcome! Just visit [my website](http://www.arthurgareginyan.com/donate.html), click on the donate button, and thank you! == Screenshots == 1. Plugin settings page. 2. Example of post with added source code and wrapped it in shortcode provided by this plugin. Default theme of highlighter. 3. Example of post with added source code and wrapped it in shortcode provided by this plugin. The "The Matrix" theme of highlighter. 4. Example of post with added source codes on multiple language and wrapped it in shortcode provided by this plugin. Default theme of highlighter. == Other Notes == "My Syntax Highlighter" is one of the personal software projects of [Arthur Gareginyan](http://www.arthurgareginyan.com). **License** This plugin is licensed under the [GNU General Public License, version 3 (GPLv3)](http://www.gnu.org/licenses/gpl-3.0.html) and is distributed free of charge. Commercial licensing (e.g. for projects that can’t use an open-source license) is available upon request. **Credits** * The icon of plugin is a copyrighted image created by [Arthur Gareginyan](http://www.arthurgareginyan.com). (C) All rights reserved. * The banner of plugin is a copyrighted image created by [Arthur Gareginyan](http://www.arthurgareginyan.com). (C) All rights reserved. * [CodeMirror](https://codemirror.net/) is an open-source project shared under the [MIT license](https://codemirror.net/LICENSE). * [Bootstrap](http://getbootstrap.com) by Twitter, Inc. released under the [MIT license](https://github.com/twbs/bootstrap/blob/master/LICENSE). * [Bootstrap-checkbox](https://github.com/vsn4ik/bootstrap-checkbox) is a project of [Vasily A.](https://github.com/vsn4ik), shared under the [MIT license](https://github.com/vsn4ik/bootstrap-checkbox/blob/master/LICENSE). **Links** * [Developer Website](http://www.arthurgareginyan.com) * [Dedicated Plugin Page on GitHub](https://github.com/ArthurGareginyan/my-syntax-highlighter) == Changelog == = 2.1 = * Added new constants: "_SLUG", "_PREFIX", "_SETTINGS" and "_NAME". * Value of the "_VERSION" constant replaced with information from the plugin header data. * All references to the plugin name, slug, prefix are replaced with constants. * Added function that render checkboxes and fields for saving plugin settings to database. * Added prefix to the name of the variable in 'wp_localize_script' WP function, to prevent conflicts. * The "_load_scripts_base" function improved. * The dynamic CSS moved from the "mshighlighter_load_scripts_dynamic_css" function to the "mshighlighter_load_scripts_base". * The "name" attribute removed from the "