Plugin Directory

Changeset 1213527


Ignore:
Timestamp:
08/05/2015 03:03:41 PM (11 years ago)
Author:
amit
Message:

added v5.0

Location:
igsyntax-hiliter
Files:
40 added
9 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • igsyntax-hiliter/trunk/ig-syntax-hiliter.php

    r669939 r1213527  
    44Plugin URI: http://blog.igeek.info/wp-plugins/igsyntax-hiliter/
    55Description: Syntax Highlighter plugin to colourize source code for various supported programming languages. See the MANUAL for more instructions.
    6 Version: 4.3
     6Version: 5.0
    77Author: Amit Gupta
    88Author URI: http://blog.igeek.info/
     
    1010*/
    1111
    12 if( ! defined('IG_SYNTAX_HILITER_VERSION') ) {
    13     define( 'IG_SYNTAX_HILITER_VERSION', 4.3 );
     12define( 'IG_SYNTAX_HILITER_ROOT', __DIR__ );
     13
     14if ( ! defined( 'IG_SYNTAX_HILITER_VERSION' ) ) {
     15    define( 'IG_SYNTAX_HILITER_VERSION', 5.0 );
    1416}
    1517
     
    1820
    1921function ig_syntax_hiliter_loader() {
    20     $igsh_plugin_dir = dirname( __FILE__ );
     22    /*
     23     * Load the Gatekeeper
     24     */
     25    require_once __DIR__ . '/classes/ig-syntax-hiliter-gatekeeper.php';
    2126
    22     //load up TLC Transient class
    23     require_once( $igsh_plugin_dir . "/tlc-transients.php" );
    24 
    25     //load up GeSHi
    26     require_once( $igsh_plugin_dir . "/geshi.php" );
    27 
    28     //load up the plugin base abstract class
    29     require_once( $igsh_plugin_dir . "/class-ig-syntax-hiliter.php" );
    30 
    31     if( is_admin() ) {
    32         //load up the plugin admin class
    33         require_once( $igsh_plugin_dir . "/class-ig-syntax-hiliter-admin.php" );
    34 
    35         if( ! isset($GLOBALS['ig_syntax_hiliter_admin']) || ! is_a( $GLOBALS['ig_syntax_hiliter_admin'], 'iG_Syntax_Hiliter_Admin' ) ) {
    36             $GLOBALS['ig_syntax_hiliter_admin'] = iG_Syntax_Hiliter_Admin::get_instance();
    37         }
    38     }
    39 
    40     if( ! is_admin() ) {
    41         //load up the plugin front-end class
    42         require_once( $igsh_plugin_dir . "/class-ig-syntax-hiliter-frontend.php" );
    43 
    44         if( ! isset($GLOBALS['ig_syntax_hiliter_frontend']) || ! is_a( $GLOBALS['ig_syntax_hiliter_frontend'], 'iG_Syntax_Hiliter_Frontend' ) ) {
    45             $GLOBALS['ig_syntax_hiliter_frontend'] = iG_Syntax_Hiliter_Frontend::get_instance();
    46         }
    47     }
    48 
    49     unset( $igsh_plugin_dir );
     27    /*
     28     * Activate the Gatekeeper
     29     */
     30    new iG_Syntax_Hiliter_Gatekeeper();
    5031}
    5132
  • igsyntax-hiliter/trunk/readme.txt

    r809790 r1213527  
    22Contributors: amit
    33Tags: syntax highlighter, code highlighter, code, source code, php, mysql, html, css, javascript
    4 Requires at least: 3.3
    5 Tested up to: 3.8
     4Requires at least: 4.1
     5Tested up to: 4.3
    66Stable tag: trunk
    77License: GPLv2
     
    1313**iG:Syntax Hiliter** allows you to post source code to your site with syntax highlighting and formatting  (as seen in code editors, IDEs). You can paste the code as is from your code editor or IDE and this plugin will take care of all the code colouring and preserve your formatting. It uses the [GeSHi library](http://qbnz.com/highlighter/) to colourize your code and supports over a 100 programming languages. Most common languages are included with the plugin and it includes drop in support for more languages used by GeSHi.
    1414
     15**NOTE :** For fast results and less load on your server, you should have a cache plugin installed. That way the plugin won't have to parse the code blocks on a post every time its loaded in browser.
     16
     17**Minimum Requirements**
     18* WordPress 4.1 or above
     19* PHP 5.3 or above
     20
     21
     22Pull requests are welcome on Github.
     23
    1524Github: https://github.com/coolamit/ig-syntax-hiliter
    1625
     
    2130###UPGRADING from v4.0 or later###
    2231
    23 Just click on the update plugin link on the WordPress admin plugins page and WordPress will take care of the upgradation. Its like upgrading any other plugin from wordpress.org plugin repo. That's quite easy!!
     32Just click `update now` link below the plugin listing on the plugins page in your `wp-admin`. That's quite easy!!
    2433
    2534###UPGRADING from v3.x###
    2635
    27 Just deactivate plugin in WordPress admin, delete the syntax_hilite.php file & "ig_syntax_hilite" directory from plugins folder and follow the installation process below. That's quite easy!!
     36Just deactivate plugin in WordPress admin, delete the `syntax_hilite.php` file & `ig_syntax_hilite` directory from plugins folder and follow the installation process below. That's quite easy!!
    2837
    2938###UPGRADING from v2.1 or lower###
    3039
    31 Just deactivate plugin in WordPress admin, delete the syntax_hilite.php and geshi.php files & "geshi" directory from plugins folder and follow the installation process below. That's quite easy!!
     40Just deactivate plugin in WordPress admin, delete the `syntax_hilite.php` and `geshi.php` files & `geshi` directory from plugins folder and follow the installation process below. That's quite easy!!
    3241
    3342###Installing The Plugin###
    3443
    35 Extract all files from the zip file and then upload it to `/wp-content/plugins/`. **Make sure to keep the file/folder structure intact.**
    36 
    37 Go to WordPress admin section, click on "Plugins" in the menu bar and then click "Activate" link under "iG:Syntax Hiliter".
     441. Login to your WordPress `wp-admin` area.
     452. Click `Add New` in the `Plugins` menu on left.
     463. Enter `iG:Syntax Hiliter` in the search bar on the right on the page that opens and press Enter key.
     474. WordPress would show the **iG:Syntax Hiliter** plugin with install button, click that to install the plugin.
     485. Click on `Activate Plugin` link on the page that opens after the plugin has been installed successfully.
    3849
    3950**See Also:** ["Installing Plugins" article on the WP Codex](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins)
     
    4354###Plugin Usage###
    4455
    45 Using this syntax highlighter is fairly easy. There is one tag and seven optional attributes. Here's how code is posted for it to be highlighted.
     56Using this syntax highlighter is fairly easy. There is one tag and 8 optional attributes. Here's how code is posted for it to be highlighted.
    4657
    4758`[sourcecode language="language_name"]
     
    6273
    6374
     75Its advised to use the full format of the tag for semantics, however its a personal choice and the plugin supports both full format and shorthand.
     76
    6477HTML entities need not be escaped, you can post your code as is and the plugin takes care of it all.
    6578
    66 For detailed usage instructions and usage of different available attributes and plugin options, please [read the manual](http://plugins.svn.wordpress.org/igsyntax-hiliter/trunk/MANUAL.txt).
     79**Important :** Do not forget to close the tags, as your code will not be hilited if you don't close your tags. Also, *don't nest tags*. Nesting of tags don't work, so don't try it, it'll ruin your output.
     80
     81Also a WYSIWYG editor (like the one bundled with WordPress) will probably mess up your code when you paste it in the editor. So if you are having that issue, then please don't report it as a bug. WYSIWYG editors are just not supported at present.
     82
     83###(Optional) Plugin Attributes###
     84
     85**language :** Use this to specify the programming language whose code you are posting. This language has to be present in `geshi` directory inside plugin directory. If `language` attribute is not specified or if a non-existent language is specified in it then a generic code box is rendered. `lang` is the shorthand for `language` attribute.
     86
     87**firstline :** Use this to start line numbering from a number greater than 1.
     88
     89**highlight :** Use this to tell plugin which lines are to be marked as different for emphasis. Line numbers are actual line numbers of code and have no relation to the ones starting as per `firstline` attribute. It accepts a comma separated list of line numbers and line number ranges like 5-8 which is equal to 5,6,7,8
     90
     91`[sourcecode language="php" highlight="2,4-6,9"]
     92//line 1 of PHP code
     93//line 2 of PHP code
     94//line 3 of PHP code
     95//line 4 of PHP code
     96//line 5 of PHP code
     97//line 6 of PHP code
     98//line 7 of PHP code
     99//line 8 of PHP code
     100//line 9 of PHP code
     101[/sourcecode]`
     102
     103**file :** Use this to show a file name/path. This is displayed in the tool-bar shown above code box.
     104
     105**gutter :** Use this to tell plugin whether to show line numbers in the code box or not. It accepts either `yes` or `no`. This, if specified, will override the global option to show line numbers for that particular code box.
     106
     107**plaintext :** Use this to tell plugin whether to show plain text option for the code box or not. It accepts either `yes` or `no`. This, if specified, will override the global option to show plain text option for that particular code box.
     108
     109**toolbar :** Use this to tell plugin whether to show tool-bar for the code box or not. It accepts either `yes` or `no`. This, if specified, will override the global option to show toolbar for that particular code box.
     110
     111**strict_mode :** Use this to tell the plugin to use GeSHi Strict Mode for a particular code box or not. This attribute accepts `always` or `never` or `maybe` as value. If you don't know what this means then its better to ignore this attribute and let it remain default.
     112
     113###Configuration###
     114
     115Configuring **iG:Syntax Hiliter** is a piece of cake. Login to your WordPress admin section & under the `Settings` menu you'll see `iG:Syntax Hiliter` in the sub-menu.
     116
     117When you click the `iG:Syntax Hiliter` configuration page, you are offered 10 configuration settings which you can set to your liking. Lets go through each of them.
     118
     119**Use plugin CSS for styling? :** This option allows you to tell the plugin whether it should use its own CSS for styling the code box (not the hilited code, just code box) or not. If you want to use your own styling for the code box, tool-bar etc then you can set it to `NO`. By default its set to `YES`.
     120
     121**GeSHi Strict Mode? :** This option allows you to tell the plugin the [strict mode](http://qbnz.com/highlighter/geshi-doc.html#using-strict-mode) setting to use with GeSHi. Strict mode can be set to be always on or off or you can set it to `MAYBE` to have GeSHi decide on its own using the language file of the language whose code you're hiliting. *If you don't have any clue about this then leave it at default setting.* By default its set to `MAYBE`. This option can be overridden for any code block using `strict_mode` attribute in the tag.
     122
     123**Languages where GeSHi strict mode is disabled :** This option lets you specify a comma separated list of languages where the GeSHi strict mode should always be disabled. Strict mode is disabled for PHP by default.
     124
     125**Show Toolbar? :** This option allows you to tell the plugin whether to show the tool-bar (which shows plain text option, file name, language name) above the code boxes or not. This option can be overridden for any code block using `toolbar` attribute in the tag.
     126
     127**Show Plain Text Option? :** This option allows you to tell the plugin whether to show the *Plain Text* view option on the code boxes or not. This option can be overridden for any code block using `plaintext` attribute in the tag.
     128
     129**Show line numbers in code? :** This option allows you to tell the plugin whether to show the line numbers along with code in the code boxes or not. Line numbers along with code look great, are a great help when referring to some code from a code box. This option can be overridden for any code block using `gutter` attribute in the tag.
     130
     131**Hilite code in comments? :** This option allows you to tell the plugin whether to hilite code posted in comments or not. If this is enabled, code posted in the comments will be hilited as it is in the posts.
     132
     133**Link keywords/function names to Manual? :** This option allows you to tell the plugin whether to link keywords, function names etc to that language's online manual or not. This works only if this feature is enabled for that particular language in GeSHi language file.
     134
     135**Enable GitHub Gist embed in comments? :** This option allows you to tell the plugin whether to embed Github Gist in comments or not. If disabled then a Gist posted in comments would just have a link to its page on Github.
     136
     137**Rebuild Shorthand Tags :** Language files in the plugin's directory and current theme (parent & child) directory are scanned and their names are cached to allow shorthand tag usage for all languages. This cache is rebuilt automatically every week. But if you wish to rebuild it manually you can do so by clicking this button.
     138
    67139
    68140== Frequently Asked Questions ==
     
    87159
    88160== ChangeLog ==
     161
     162= v5.0 =
     163
     164* Minimum required PHP version bumped to 5.3.0. The plugin simply won't load its code on lower versions.
     165* Major re-write of plugin for cleaner, modular & better performing code.
     166* NEW: You can now disable plugin stylesheet which styles code boxes. People who have their own styling don't need it anyway.
     167* NEW: 2 new options allow more control on GeSHi behaviour.
     168* BUGFIX: Language name cache was not re-building automatically.
    89169
    90170= v4.3 =
     
    116196* IMPROVED: Simpler and faster options page in wp-admin
    117197
    118 
    119 Changelog of versions prior to v4.0 is available in the [manual](http://plugins.svn.wordpress.org/igsyntax-hiliter/trunk/MANUAL.txt).
     198= v3.5 =
     199
     200* BUGFIX: BB Tags except the ones of iG:Syntax Hiliter are allowed. The language file's existence is checked before parsing the code. If the language file does not exist then the code is not parsed.
     201* BUGFIX: 'C' code hiliting is now fixed.
     202* BUGFIX: 'Plain Text' has been improved to strip the extra blank lines and spaces in Opera and FireFox.
     203* The latest stable GeSHi core(v1.0.7.6).
     204* NEW: Code Hiliting for Comments has been implemented. This feature can be Enabled/Disabled from the admin interface for iG:Syntax Hiliter. The tags are same for hiliting the code.
     205* NEW: A cross-browser Colour Picker(tested in IE6, FireFox1.5 and Opera8.5) is now available to easily set the line colours displayed in the code box.
     206* NEW: A new type of view implemented for seeing "Plain Text" code. Besides opening the plain text code in a new window, you can have it displayed in the code box itself with an option to display the hilited HTML code back again. The "Plain Text" view type can be set in the admin interface.
     207* The language file for Ruby that I created a while back is now bundled with the plugin and its also a part of the default GeSHi package.
     208
     209= v3.1 =
     210
     211* BUGFIX: Critical bug, which broke the plugin when the square brackets([ & ]) were used in the posts in places other than tags, has been fixed.
     212* BUGFIX: Another bug, which allowed any attribute in the tags besides the 'num' and also allowed any attribute value for it, affecting the processing. Now only the 'num' attribute is accepted and if you specify the 'num' attribute then its value must be a positive number otherwise your code won't be hilited. The 'num' attribute is optional and you can leave it out without any problems.
     213* BUGFIX: Fixed the unclosed <select> tags in the Plugin GUI code.
     214* GeSHi BUGFIX: Fixed a bug in GeSHi where the first line colour was not used when using FANCY LINE NUMBERS thus resulting in just one colour being used for the alternate lines.
     215* There's a problem in WordPress due to which the starting delimiters of ASP, PHP were not displayed correctly, as whitespace was inserted between the '<' and the rest of the delimiter. This has been patched so that its displayed correctly, but its not saved in the database, so the database still contains the delimiters as formatted by WordPress.
     216
     217= v3.0 =
     218
     219* Complete re-write of the plugin resulting in reduction of code from 750+ lines to about 400 Lines.
     220* New GeSHi Core(v1.0.7) which has some bug-fixes, please see GeSHi Website for its changelog.
     221* New languages added are C#, Delphi, Smarty & VB.NET.
     222* ASP language file structure updated & more keywords added.
     223* Drag-n-Drop usage of new languages. The plugin now supports all languages that GeSHi(v1.0.7) supports. You just need to drop the language file in the "geshi" directory & use the filename as the tag for the language(like if file is "pascal.php", then the filename is "pascal" & the tags will be [pascal] & [/pascal]).
     224* Language name which is displayed in the Code-Box can now be turned ON or OFF easily.
     225* No more need to set the physical-path to the "geshi" directory if you are doing a default installation.
     226* Plain-Text View of the code hilited in the code-box is now possible. This feature can be enabled/disabled easily in the Configuration Interface in WordPress Administration.
     227* NO NEED TO EDIT THE PLUGIN FILE ANYMORE. You can now configure the plugin settings from a GUI located under the OPTIONS menu in your WordPress Administration(WordPress 1.5 & above only).
     228
     229= v2.01 =
     230
     231* BUGFIX: Fixed a bug by removing a <br /> tag from the function pFix() which lead to closing of an unnecessary <p> tag making the code not xHTML valid(as per my desires).
     232
     233= v2.0 Final =
     234
     235* Implemented the new version of GeSHi core, v1.0.2 which has some bug fixes & which uses OL(Ordered Lists) for Line Numbering and supports starting of a Line Number from any given number.
     236* The ASP(Active Server Pages) language file has been updated to the new Language File structure of GeSHi as well as more keywords added & hiliting is more effective now.
     237* iG:Syntax Hiliter now also supports ActionScript, C, C++, JavaScript, Perl, Python, Visual Basic & XML.
     238* The whole plugin has been re-written & all the hiliting code is now in a class. You can just use the class anywhere else too for hiliting the code. But to also use the Code Tags to wrap your code & then hilite them, you will need to use all other functions. You can remove the WordPress Filter calls at the end of the plugin & use the rest of the code as you want somewhere else.
     239* BUGFIX: The issue of multi-line comments not being hilited properly in v2.0 Preview has been sorted out.
     240
     241= v2.0 Preview =
     242
     243* Implemented the new version of GeSHi core, v1.0.1 which has some bug fixes including the extra quote(") bug that broke the xHTML validation of the code.
     244* I've created a new language file for ASP(Active Server Pages) which has been added to this release & will also be a part of the next GeSHi release.
     245* Line numbering is now done through Ordered Lists(<OL>) & the code is xHTML compliant.
     246* Auto-Formatting disabled for posts that contain the iG:Syntax Hiliter code tags so that your code is good for copy-paste operations.
     247
     248= v1.1 =
     249
     250* Implemented the line numbering of code.
     251* The code box is now of fixed dimensions without word-wrap & with scrollbars(if required).
     252
     253= v1.0 =
     254
     255* Hilites code between the special tags, all of them differently.
     256* Uses GeSHi for syntax hiliting.
     257* Supports HTML, CSS, PHP, JAVA & SQL codes.
     258
    120259
    121260== Upgrade Notice ==
    122261
    123 = 4.3 =
    124 This version fixes a bug in v4.2 which caused unwanted snipping of language names when building language file name cache.
    125 
    126 
    127 
    128 
     262= 5.0 =
     263Major re-write of plugin for cleaner, modular & better performing code. Fixes automatic tag cache rebuilds, new options allow more control over plugin and GeSHi.
     264
     265
     266
     267
Note: See TracChangeset for help on using the changeset viewer.