Lines Matching full:keyword
43 + 3.4.3 Setting Keyword Styles
60 + 3.11.1 Adding a Keyword
61 + 3.11.2 Removing a Keyword
62 + 3.11.3 Adding a Keyword Group
63 + 3.11.4 Removing a Keyword Group
65 + 3.12.1 Keyword Substitution
70 o 3.13 Keyword URLs
71 + 3.13.1 Setting a URL for a Keyword Group
72 + 3.13.2 Disabling URLs for a Keyword Group
498 As of version 1.0.2, GeSHi comes with a contrib/ directory, which in it contains a "wizard" script for creating a stylesheet. Although this script is by no means a complete solution, it will create the necessary rules for the basic lexics - comments, strings for example. Things not included in the wizard include regular expressions for any language that uses them (PHP and XML are two languages that use them), and keyword-link styles. However, this script should take some of the tedium out of the job of making an external stylesheet. Expect a much better version of this script in version 1.2!
542 3.4.3: Setting Keyword Styles
545 Perhaps the most regular change you will make will be to the styles of a keyword set. In order to change the styles for a particular set, you'll have to know what the set is called first. Sets are numbered from 1 up. Typically, set 1 contains keywords like if, while, do, for, switch etc, set 2 contains null, false, true etc, set 3 contains function inbuilt into the language (echo, htmlspecialchars etc. in PHP) and set 4 contains data types and similar variable modifiers: int, double, real, static etc. However these things are not fixed, and you should check the language file to see what key you want. Having a familiarity with a language file is definately a plus for using it.
547 To change the styles for a keyword set, call the set_keyword_group_style() method:
604 When I say "lexic", I mean "keywords". Any keyword in any keyword array will be modified using this option! This is one small area of inflexibility I hope to fix in 1.2.X.
618 Some languages, like PHP, don't mind what case function names and keywords are in, while others, like Java, depend on such pickiness to maintain their bad reputations ;). In any event, you can use the set_case_sensitivity to change the case sensitiveness of a particular keyword group from the default:
621 Where $key is the key of the group for which you wish to change case sensitivness for (see the language file for that language), and $sensitivity is a boolean value - true if the keyword is case sensitive, and false if not.
717 * set_keyword_group_highlighting($group, $flag): Sets whether a particular $group of keywords is to be highlighted or not. Consult the necessary language file(s) to see what $group should be for each group (typically a positive integer). $flag is false if you want to disable highlighting of this group, and true if you want to re-enable higlighting of this group. If you disable a keyword group then even if the keyword group has a related URL one will not be generated for that keyword.
760 3.11.1: Adding a Keyword
763 If you want to add a keyword to an existing keyword group, you use the add_keyword method:
766 Where $key is the index of the group of keywords you want to add this keyword to, and $word is the word to add.
772 3.11.2: Removing a Keyword
775 Perhaps you want to remove a keyword from an existing group. Maybe you don't use it and want to save yourself some time. Whatever the reason, you can remove it using the remove_keyword method:
778 Where $key is the index of the gropu of keywords that you want to remove this keyword from, and $word is the word to remove.
782 This function is silent - if the keyword is not in the group you specified, nothing awful will happen ;)
783 3.11.3: Adding a Keyword Group
788 You add a keyword group by using the add_keyword_group method:
794 Adds a keyword group referenced by index 10, of which all keywords in the group will be dark red, each keyword can be in any case and which contains the keywords "myfunc_1", "myfunc_2" and "myfunc_3".
796 After creating such a keyword group, you may call other GeSHi methods on it, just as you would for any other keyword group.
799 If you specify a $key for which there is already a keyword group, the old keyword group will be overwritten! Most language files don't use numbers larger than 5, so I recommend you play it safe and use a number like 10 or 42.
800 3.11.4: Removing a Keyword Group
803 Perhaps you *really* need speed? Why not just remove an entire keyword group? GeSHi won't have to loop through each keyword checking for its existance, saving much time. You remove a keyword group by using the remove_keyword_group method:
811 3.12.1: Keyword Substitution
848 3.13: Keyword URLs
851 As of version 1.0.2, GeSHi allows you to specify a URL for keyword groups. This URL is used by GeSHi to convert the keywords in that group into URLs to appropriate documentation. And using add_keyword_group you can add functions and classes from your own projects and use the URL functionality to provide a link to your own API documentation.
852 3.13.1: Setting a URL for a Keyword Group
855 To set the URL to be used for a keyword group, you use the set_url_for_keyword_group method:
858 Where $group is the keyword group you want to assign the URL for, and $url is the URL for this group of keywords.
860 You may be wondering how to make each keyword in the group point to the correct URL. You do this by putting {FNAME} in the URL at the correct place. For example, PHP makes it easy by linking www.php.net/function-name to the documentation for that function, so the URL used is http://www.php.net/{FNAME}.
865 As of Version 1.0.7.21 there have been added two more symbols you can use to link to functions. {FNAMEL} will generate the lowercase version of the keyword, {FNAMEU} will generate the upper-case version. {FNAME} will provide the keyword as specified in the language file.
866 3.13.2: Disabling a URL for a Keyword Group
869 It's easy to disable a URL for a keyword group: Simply use the method set_url_for_keyword_group to pass an empty string as the URL:
1434 o GESHI_CAPS_NO_CHANGE: Don't change the case of any keyword.
1477 * Keywords sorted in reverse: Keywords *should* be sorted in reverse order. I know that many of the language files I've made do not follow this rule, but that's because I made the files before I discovered the following issue with GeSHi: If you have two keywords, as and ascfor example, then when GeSHi encounters the "as" keyword it will be highlighted even if the "as" is part of "asc". I would get GeSHi to reverse-sort keyword arrays, but there's no harm in you doing this yourself and saving some processing time. At the least (and in fact this is sufficient) you should swap any keywords you come across that would be caught by this issue.
1478 * Keywords are case sensitive (sometimes): If your language is case-sensitive, the correct casing of the keywords is defined as the case of the keywords in these keyword arrays. If you check the java language file you will see that everything is in exact casing. So if any of these keyword arrays are case sensitive, put the keywords in as their correct case! (note that which groups are case sensitive and which are not is configurable, see later on)
1479 * Keywords must be in htmlentities() form: All keywords should be written as if they had been run through the php function htmlentities(). E.g, the keyword is <foo>, not <foo>
1486 So you've put all the keywords for your language in? Now for a breather before we style them :). Symbols define what symbols your language uses, these are things like colons, brackets/braces, and other such general punctuation, and case sensitivity alludes to the previous section: here you can set which keyword groups are case sensitive.
1576 * 'KEYWORDS': This is an array, from keyword index to style. The index you use is the index you used in the keywords section to specify the keywords belonging to that group.
1585 This section lets you specify a url to visit for each keyword group. Useful for pointing functions at their online manual entries.
1596 The indices of this array correspond to the keyword groups you specified in the keywords section. The string {FNAME} marks where the name of the function is substituted in. So for the example above, if the keyword being highlighted is "echo", then the keyword will be a URL pointing to http://www.php.net/echo. Because some languages (Java!) don't keep a uniform URL for functions/classes, you may have trouble in creating a URL for that language (though look in the java language file for a novel solution to it's problem)
1611 Regular expressions are a good way to catch any other lexic that fits certain rules but can't be listed as a keyword. A good example is variables in PHP: variables always start with either one or two "$" signs, then alphanumeric characters (a simplification). This is easy to catch with regular expressions.