Syntax highlightning on the forums

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
ChrisR
Addict
Addict
Posts: 1466
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Syntax highlightning on the forums

Post by ChrisR »

HeX0R wrote: Thu Aug 19, 2021 1:02 pm is is the highliter from PRISM (see my link) and out of Freds hands.
I made the initial highliter for prism once in the past for my own need, and I'm fine with it.
And you are not willing to change it (no option you said), so, live with it or wait until someone else fixes it.
It's very useful to better read the code but there are very few codes using [ code-pb ] [ /code-pb ], including all former code.
Is it possible to implement it for [ code ] [ /code ] tags ? Is it in Fred's hands ?
Otherwise, is there any way to do it locally ?
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Syntax highlightning on the forums

Post by HeX0R »

It's very useful to better read the code but there are very few codes using [ code-pb ] [ /code-pb ], including all former code.
Is it possible to implement it for [ code ] [ /code ] tags ? Is it in Fred's hands ?
Yes, this is in Freds hands
Otherwise, is there any way to do it locally ?
You can use this user script from STARGÅTE.
[Edit]
Oh, when reading through that thread, I can see, that you are already using it, anyway, I'll keep the link in for others.
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: Syntax highlightning on the forums

Post by StarBootics »

@Fred : Apparently the keyword "ForEver" is missing in the Syntax highlighting.

Code: Select all

Repeat
ForEver
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Syntax highlightning on the forums

Post by HeX0R »

Mijikai wrote: Sun Jun 06, 2021 10:57 am Not sure where to post this...
The syntax highlighting doesnt like #Null$ its wrong.

Example:

Code: Select all

#Null$
StarBootics wrote: Mon Oct 11, 2021 12:00 pm @Fred : Apparently the keyword "ForEver" is missing in the Syntax highlighting.

Code: Select all

Repeat
ForEver
Best regards
StarBootics
I've fixed both in prism, but I don't know when the forum plugin will keep track on it.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Syntax highlightning on the forums

Post by skywalk »

@HeXOR - you have edit access to the forum?
When I paste

Code: Select all

;Some PB code here...
, PureBasic is the leftmost button and then Copy button.
If I paste

Code: Select all

;Some text here...
, then Purebasic is under the Copy button :(
How to make Purebasic always the left side button?

Code: Select all

Procedure IncrementCallback(JsonParameters$)
  Static Count  
  Debug #PB_Compiler_Procedure +": " + JsonParameters$  
  Count + 1
  ProcedureReturn UTF8(~"{ \"count\": "+Str(Count)+ "}")
EndProcedure

Procedure ComputeCallback(JsonParameters$)  
  Debug #PB_Compiler_Procedure +": " + JsonParameters$  
  Dim Parameters(0)  
  ; Extract the parameters from the JSON
  ParseJSON(0, JsonParameters$)
  ExtractJSONArray(JSONValue(0), Parameters())  
  Debug "Parameter 1: " + Parameters(0)
  Debug "Parameter 2: " + Parameters(1)    
  ProcedureReturn UTF8(Str(Parameters(0) + Parameters(1)))
EndProcedure

OpenWindow(0, 100, 100, 400, 400, "Hello", #PB_Window_SystemMenu | #PB_Window_Invisible)
WebViewGadget(0, 0, 0, 400, 400)
SetGadgetText(0, "file://" + #PB_Compiler_Home + "examples/sources/Data/WebView/webview.html")  
BindWebViewCallback(0, "increment", @IncrementCallback())
BindWebViewCallback(0, "compute", @ComputeCallback())
; Show the window once the webview has been fully loaded
HideWindow(0, #False)
Repeat 
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: Syntax highlightning on the forums

Post by HeX0R »

skywalk wrote: Thu Mar 27, 2025 10:20 pm @HeXOR - you have edit access to the forum?
No!
Guess all we'd need is another code symbol for [code-pb.] tags
I even forgot the tag name now and tried pb-code, pbcode, codepb, until I found the right one, code-pb (murphy's law got me)
Or does such a button exist in one of the other board themes?

But it looks like a bug anyway, I wasn't even aware that there is a PureBasic box under the copy button (I don't really see it).
User avatar
Piero
Addict
Addict
Posts: 865
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Syntax highlightning on the forums

Post by Piero »

Not really sure this may help, anyway:
I use the [code=purebasic] tag (found long time ago by examining forum HTML source)
Quin
Addict
Addict
Posts: 1126
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Syntax highlightning on the forums

Post by Quin »

I always do code-pb and /code-pb, it seems to give me the PureBasic code block, at least according to my screen reader.
User avatar
Piero
Addict
Addict
Posts: 865
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Syntax highlightning on the forums

Post by Piero »

Quin wrote: Fri Mar 28, 2025 2:39 pm I always do code-pb and /code-pb, it seems to give me the PureBasic code block, at least according to my screen reader.
/code-pb works?
Try just /code
Quin
Addict
Addict
Posts: 1126
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Syntax highlightning on the forums

Post by Quin »

Piero wrote: Fri Mar 28, 2025 3:02 pm
Quin wrote: Fri Mar 28, 2025 2:39 pm I always do code-pb and /code-pb, it seems to give me the PureBasic code block, at least according to my screen reader.
/code-pb works?
Try just /code
Oh, that's cool! I assumed BBCode was pedantic like HTML and wanted the same opening/closing tags. Think I'm going to keep using code-pb because it's habbit, but that's super neat.
User avatar
Piero
Addict
Addict
Posts: 865
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Syntax highlightning on the forums

Post by Piero »

Quin wrote: Fri Mar 28, 2025 3:04 pmThink I'm going to keep using code-pb
I'm going to keep using code=purebasic because I have "text macros" :wink:
Quin
Addict
Addict
Posts: 1126
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Syntax highlightning on the forums

Post by Quin »

Piero wrote: Fri Mar 28, 2025 3:17 pm
Quin wrote: Fri Mar 28, 2025 3:04 pmThink I'm going to keep using code-pb
I'm going to keep using code=purebasic because I have "text macros" :wink:
Sounds like as long as none of the methods break, we're still in business :D
User avatar
Piero
Addict
Addict
Posts: 865
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Syntax highlightning on the forums

Post by Piero »

Quin wrote: Fri Mar 28, 2025 3:52 pm
Piero wrote: Fri Mar 28, 2025 3:17 pm
Quin wrote: Fri Mar 28, 2025 3:04 pmThink I'm going to keep using code-pb
I'm going to keep using code=purebasic because I have "text macros" :wink:
Sounds like as long as none of the methods break, we're still in business :D
Well, in case, it would be easy for me to adapt the """macros"""… anyway, just out of curiosity, do you use/know something that easily lets you enclose (selected) text with opening/closing tags?
I mean, on windows… :P :mrgreen:

Mac PS:
Free: AppleScript
Almost Free: LaunchBar
Paid: PopClip
Quin
Addict
Addict
Posts: 1126
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Syntax highlightning on the forums

Post by Quin »

Piero wrote: Fri Mar 28, 2025 4:21 pm
Quin wrote: Fri Mar 28, 2025 3:52 pm
Piero wrote: Fri Mar 28, 2025 3:17 pm
Quin wrote: Fri Mar 28, 2025 3:04 pmThink I'm going to keep using code-pb
I'm going to keep using code=purebasic because I have "text macros" :wink:
Sounds like as long as none of the methods break, we're still in business :D
Well, in case, it would be easy for me to adapt the """macros"""… anyway, just out of curiosity, do you use/know something that easily lets you enclose (selected) text with opening/closing tags?
I mean, on windows… :P :mrgreen:

Mac PS:
Free:
AppleScript
Almost Free:
LaunchBar
Paid:
PopClip
The same program I'm using to browse these forums...edbrowse, a command-line editor/web browser/email client/IRC client.
User avatar
Piero
Addict
Addict
Posts: 865
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Syntax highlightning on the forums

Post by Piero »

Quin wrote: Fri Mar 28, 2025 4:39 pmedbrowse
Thanks!
Post Reply