Allowing and explicating language-specific highlighting
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 19 Dec 2005 20:25:37 +0000 (20:25 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 19 Dec 2005 20:25:37 +0000 (20:25 +0000)
templates/default/code2.css
view.php

index 8cfced4170a8d277041b95741592e0794ee0abb0..9b2364ce832fcc1e656ea4d676711f7a320ccc6d 100644 (file)
 * Trac is under the GNU GPL version 2
 */
 
+/*
+* The definitions in this file apply to ALL types of highlighting. If you want to
+* add more definitions (from other types of keywords by GeSHi) then you can name them
+* ".code .CLASS_NAME" to have them apply to all languages. If you want to add or
+* override a definition for a specific language, use ".GESHI_LANGUAGE .CLASS_NAME".
+*
+* This works because the code is wrapped like this:
+* <div class="code">
+*      <div class="GESHI_LANGUAGE">
+*      </div>
+* </div>
+*/
+
 /* Key Words I (if, do, while, etc.) */
 .code .kw1
 {
index 8aaf1d5cee4d3561d3bfcba5b29c6e7954af51ea..2489e4dab8ff404c9c086315ef151ab27fec2f8d 100644 (file)
--- a/view.php
+++ b/view.php
@@ -66,7 +66,7 @@ $geshi = new Geshi($catdata, $language[MIMES_GESHI_LANGUAGE]);
 $geshi->enable_classes();
 
 // header
-$geshi->set_header_type(GESHI_HEADER_NONE);
+$geshi->set_header_type(GESHI_HEADER_DIV);
 
 // disable links
 $urls = array_keys($geshi->language_data['URLS']);
@@ -75,9 +75,6 @@ foreach ($urls AS $key)
        $geshi->set_url_for_keyword_group($key, '');
 }
 
-// css info
-$geshi->set_overall_class('code');
-
 // don't do anything stupid
 $geshi->set_case_keywords(GESHI_CAPS_NO_CHANGE);