[Forum] bbGeSHi - a better syntax highlighter

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
Ky6uk
Posts: 45
Joined: Sun Apr 06, 2008 7:36 am
Location: Russia, Ufa
Contact:

[Forum] bbGeSHi - a better syntax highlighter

Post by Ky6uk »

It would be desirable to see it. :)
link: http://www.phpbb.com/community/viewtopi ... 9#p3100415
Whether it is possible?
Sorry for my bad english. >_<
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by ThePhoenixBird »

I will look at it
User avatar
DrLecter
L2j Inner Circle
L2j Inner Circle
Posts: 705
Joined: Sat Jul 23, 2005 8:32 pm
Contact:

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by DrLecter »

Implemented, tnx for suggestions and ThePhoenixBird's assistance.
Search HERE. Read HERE. Then write.
User avatar
Ky6uk
Posts: 45
Joined: Sun Apr 06, 2008 7:36 am
Location: Russia, Ufa
Contact:

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by Ky6uk »

Oh, good work.

PS: Maybe add small menu (list) for select popular code highlighting (diff, py, java, etc.)?
Sorry for my bad english. >_<
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: [Forum] bbGeSHi - a better syntax highlighter

Post 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]
GodKratos
L2j Veteran
L2j Veteran
Posts: 418
Joined: Fri Jan 25, 2008 6:09 am

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by GodKratos »

Eeek, some of those highlighting styles look really bad with the black theme :shock:
Image
User avatar
Ky6uk
Posts: 45
Joined: Sun Apr 06, 2008 7:36 am
Location: Russia, Ufa
Contact:

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by Ky6uk »

Use classic style. It more ergonomically and more habitually. =)
Sorry for my bad english. >_<
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: [Forum] bbGeSHi - a better syntax highlighter

Post 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
User avatar
DrLecter
L2j Inner Circle
L2j Inner Circle
Posts: 705
Joined: Sat Jul 23, 2005 8:32 pm
Contact:

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by DrLecter »

you can also do
Search HERE. Read HERE. Then write.
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by ThePhoenixBird »

Example: without the *
GodKratos
L2j Veteran
L2j Veteran
Posts: 418
Joined: Fri Jan 25, 2008 6:09 am

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by GodKratos »

you know what would be good... if the GeSHi highlighter had a diff mode for highlighting patch syntax like TortoiseDiff does ;)
Image
User avatar
ThePhoenixBird
L2j Inner Circle
L2j Inner Circle
Posts: 1857
Joined: Fri May 27, 2005 5:11 pm

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by ThePhoenixBird »

use diff in the code tags

[diff*]
code
[/diff]

or

[*code=diff]
code
[/code]

remove the *
GodKratos
L2j Veteran
L2j Veteran
Posts: 418
Joined: Fri Jan 25, 2008 6:09 am

Re: [Forum] bbGeSHi - a better syntax highlighter

Post by GodKratos »

ah nice, it works :D awesome ;)
Image
angelo2007
Posts: 1
Joined: Sat Feb 13, 2010 6:03 pm

Re: [Forum] bbGeSHi - a better syntax highlighter

Post 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; 
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: [Forum] bbGeSHi - a better syntax highlighter

Post 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? :?
Image

Leadership and management are not talk and talk, but talk and do

Proud of being a part of this project
Post Reply