Page 1 of 1

[Forum] bbGeSHi - a better syntax highlighter

Posted: Sat Jun 07, 2008 5:03 pm
by Ky6uk
It would be desirable to see it. :)
link: http://www.phpbb.com/community/viewtopi ... 9#p3100415
Whether it is possible?

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Thu Jun 19, 2008 2:37 am
by ThePhoenixBird
I will look at it

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Mon Jul 14, 2008 1:14 am
by DrLecter
Implemented, tnx for suggestions and ThePhoenixBird's assistance.

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Mon Jul 14, 2008 7:59 pm
by Ky6uk
Oh, good work.

PS: Maybe add small menu (list) for select popular code highlighting (diff, py, java, etc.)?

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Mon Jul 14, 2008 11:19 pm
by ThePhoenixBird
Well this is just an small example of how it works.

GeSHi supports a lot of languages:
  • ABAP
  • Actionscript
  • ADA
  • Apache Log
  • AppleScript
  • ASM
  • ASP
  • AutoIT
  • Backus-Naur form
  • Bash
  • BlitzBasic
  • C
  • C for Macs
  • C#
  • C++
  • CAD DCL
  • CadLisp
  • CFDG
  • ColdFusion
  • CSS
  • D
  • Delphi
  • DIV
  • DOS
  • Eiffel
  • Fortran
  • FreeBasic
  • GML
  • Groovy
  • Haskell
  • HTML
  • Inno
  • IO
  • Java
  • Java 5
  • Javascript
  • LaTeX
  • Lisp
  • Lua
  • Microprocessor ASM
  • mIRC
  • MySQL
  • NSIS
  • Objective C
  • OCaml
  • OpenOffice BASIC
  • Oracle 8 SQL
  • Pascal
  • Perl
  • PHP
  • PL/SQL
  • Python
  • Q(uick)BASIC
  • robots.txt
  • Ruby
  • SAS
  • Scheme
  • SDLBasic
  • Smalltalk
  • Smarty
  • SQL
  • T-SQL
  • TCL
  • thinBasic
  • Uno IDL
  • VB.NET
  • Visual BASIC
  • Visual Fox Pro
  • Winbatch
  • X++
  • XML
  • Z80 ASM

You only need to put the bbCode tags [*xml] [/xml] (without the * of course) for the language that you need, you can change the "xml" for any language listed over for example [*sql] [/sql], [*php] [/php] or whatever you want.

Here is some examples of the use of this mod:

PLEASE NOTICE THAT FOR JYTHON HIGHTLIGHT USE PYTHON INSTEAD!



SQL HIGHTLIGHT EXAMPLE
[sql] REPLACE INTO `zone_vertices` VALUES(11021,0,15704,15397),(11021,1,15765,15878),(11021,2,15801,16332),(11021,3,14098,19672),(11021,4,10278,20689),(11021,5,8852,20421),(11021,6,7484,18628),(11021,7,7236,18042),(11021,8,7141,17507),(11021,9,7045,16819),(11021,10,7382,14486),(11021,11,13891,13025); [/sql]

JYTHON (PYTHON) HIGHTLIGHT EXAMPLE
[python] # Made by Emperorcimport sysfrom net.sf.l2j.gameserver.model.quest import Statefrom net.sf.l2j.gameserver.model.quest import QuestStatefrom quests.SagasSuperclass import Quest as JQuest qn = "78_SagaOfTheDoomcryer"qnu = 78qna = "Saga of the Doomcryer" class Quest (JQuest) :  def __init__(self,id,name,descr):     # first initialize the quest.  The superclass defines variables, instantiates States, etc     JQuest.__init__(self,id,name,descr)     # Next, override necessary variables:     self.NPC = [31336,31624,31589,31290,31642,31646,31649,31650,31654,31655,31657,31290]     self.Items = [7080,7539,7081,7493,7276,7307,7338,7369,7400,7431,7101,0]     self.Mob = [27295,27227,27285]     self.qn = qn     self.classid = 116     self.prevclass = 0x34     self.X = [191046,46087,46066]     self.Y = [-40640,-36372,-36396]     self.Z = [-3042,-1685,-1685]     self.Text = ["PLAYERNAME! Pursued to here! However, I jumped out of the Banshouren boundaries! You look at the giant as the sign of power!",                  "... Oh ... good! So it was ... let's begin!","I do not have the patience ..! I have been a giant force ...! Cough chatter ah ah ah!",                  "Paying homage to those who disrupt the orderly will be PLAYERNAME's death!","Now, my soul freed from the shackles of the millennium, Halixia, to the back side I come ...",                  "Why do you interfere others' battles?","This is a waste of time.. Say goodbye...!","...That is the enemy",                  "...Goodness! PLAYERNAME you are still looking?","PLAYERNAME ... Not just to whom the victory. Only personnel involved in the fighting are eligible to share in the victory.",                  "Your sword is not an ornament. Don't you think, PLAYERNAME?","Goodness! I no longer sense a battle there now.","let...","Only engaged in the battle to bar their choice. Perhaps you should regret.",                  "The human nation was foolish to try and fight a giant's strength.","Must...Retreat... Too...Strong.","PLAYERNAME. Defeat...by...retaining...and...Mo...Hacker","....! Fight...Defeat...It...Fight...Defeat...It..."]     # finally, register all events to be triggered appropriately, using the overriden values.     JQuest.registerNPCs(self) QUEST       = Quest(qnu,qn,qna) [/python]

XML HIGHTLIGHT EXAMPLE
[xml] <skill id="1459" levels="1" name="Divine Power">  <!-- Done by DJ MELERIX -->  <set name="castRange" val="-1"/>  <set name="effectRange" val="-1"/>  <set name="hitTime" val="2000"/>  <set name="isMagic" val="true"/>  <set name="mpConsume" val="109"/>  <set name="operateType" val="OP_ACTIVE"/>  <set name="power" val="0.0"/>  <set name="reuseDelay" val="600000"/>  <set name="skillType" val="BUFF"/>  <set name="target" val="TARGET_SELF"/>  <for>    <effect count="1" name="Buff" time="10" val="0" stackOrder="1000" stackType="giveHp">      <add order="0x30" stat="bonusHp" val="1000"/>    </effect>  </for></skill> [/xml]

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Tue Jul 15, 2008 1:59 am
by GodKratos
Eeek, some of those highlighting styles look really bad with the black theme :shock:

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Tue Jul 15, 2008 7:23 am
by Ky6uk
Use classic style. It more ergonomically and more habitually. =)

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Tue Jul 15, 2008 7:32 pm
by ThePhoenixBird
GodKratos wrote:Eeek, some of those highlighting styles look really bad with the black theme :shock:

It doesnt look so bad :?

Dark highlight for dark theme

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Thu Jul 17, 2008 5:07 am
by DrLecter
you can also do

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Thu Jul 17, 2008 7:22 pm
by ThePhoenixBird
Example: without the *

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Sat Aug 23, 2008 12:10 pm
by GodKratos
you know what would be good... if the GeSHi highlighter had a diff mode for highlighting patch syntax like TortoiseDiff does ;)

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Sun Aug 24, 2008 12:57 am
by ThePhoenixBird
use diff in the code tags

[diff*]
code
[/diff]

or

[*code=diff]
code
[/code]

remove the *

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Sun Aug 24, 2008 3:04 am
by GodKratos
ah nice, it works :D awesome ;)

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Sat Feb 13, 2010 6:25 pm
by angelo2007
aqui probando cmo funciona geshi. en phpbb

Code: Select all

  if IsRightToLeft then  begin    Inc(TextRect.Left, 10);    TextFormat := DT_LEFT  end  else  begin    Dec(TextRect.Right, 10);    TextFormat := DT_RIGHT;  end; 

Re: [Forum] bbGeSHi - a better syntax highlighter

Posted: Sat Feb 13, 2010 9:54 pm
by DrHouse
angelo2007 wrote:aqui probando cmo funciona geshi. en phpbb

Code: Select all

  if IsRightToLeft then  begin    Inc(TextRect.Left, 10);    TextFormat := DT_LEFT  end  else  begin    Dec(TextRect.Right, 10);    TextFormat := DT_RIGHT;  end; 
What kind of joke is this? :?