SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard wonshikee's Avatar
    Join Date
    Jan 2007
    Posts
    1,223
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    TEXT_Highlighter

    I managed to get PEAR installed and got all the includes done, but I am unsure how to create the CSS file that the Text_Highlighter is supposed to read off of.

    Is this something I have to create from scratch? The code that is output is like this:

    HTML Code:
    <span class="hl-identifier">#id</span><span class="hl-code"> </span><span class="hl-brackets">{</span>
    Am I supposed to define all those css classes, or is this something that is already created?

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    text highlighter

    The classes are added by TEXT_Highlighter. All you need to do is create CSS rules to apply your styles to the classes and include it in your pages that include a highlighted file.
    I prefer to put the syles in a seperate file rather than in the page, but this PEAR tutorial should help. http://pear.php.net/package/Text_Hig...using.pkg.html

  3. #3
    SitePoint Wizard wonshikee's Avatar
    Join Date
    Jan 2007
    Posts
    1,223
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <style>
    	.hl-main {font-family: monospace; font-size:13px;}
    		
    	.hl-default { color: #000000; }
    	.hl-code { color: #7f7f33; }
    	.hl-brackets { color: #009966; }
    	.hl-comment { color: #7F7F7F; }
    	.hl-quotes { color: #00007F; }
    	.hl-string { color: #7F0000; }
    	.hl-identifier { color: #000000; }
    	.hl-reserved { color: #7F007F; }
    	.hl-inlinedoc { color: #0000FF; }
    	.hl-var { color: #0066FF; }
    	.hl-url { color: #FF0000; }
    	.hl-special { color: #0000FF; }
    	.hl-number { color: #007F00; }
    	.hl-inlinetags { color: #FF0000; }
    </style>
    This is what I was looking for, if there were already default CSS classes defined or if I had to create them all from scratch. Thank you.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •