Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
PBJim
Enthusiast
Enthusiast
Posts: 293
Joined: Fri Jan 19, 2024 11:56 pm

Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by PBJim »

With the prevalence of code copied from the IDE straight into this forum, it would be convenient to have an Edit menu option in the IDE, called for example Copy with[code-pb] or Copy as Forum Text.

Image

It's just that [code-pb] ...[/code-pb] makes the examples more readable on this forum.
plouf
Enthusiast
Enthusiast
Posts: 281
Joined: Fri Apr 25, 2003 6:35 pm
Location: Athens,Greece

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by plouf »

i dont get what more this will have from already existing [.code.] -> [</>] icon

Code: Select all

procedure start()
 nop
endprocedure
yellow (pb style) code allows yo to direct copy it from here too ?
Christos
PBJim
Enthusiast
Enthusiast
Posts: 293
Joined: Fri Jan 19, 2024 11:56 pm

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by PBJim »

plouf wrote: Tue Nov 05, 2024 6:35 am i dont get what more this will have from already existing [.code.] -> [</>] icon
Hello plouf,
[code-pb] ...[/code-pb] is an existing feature of the forum, but I don't know about others, with not great eyesight these days, I find it a real pain to see where to insert the -PB so precisely.
infratec
Always Here
Always Here
Posts: 7575
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by infratec »

You get syntax highlightning

Code: Select all

procedure start()
 nop
endprocedure
If you use code=PureBasic

But this is more a feature request for the forum, to use this as standard.
code=html works for ... html code.
Axolotl
Enthusiast
Enthusiast
Posts: 798
Joined: Wed Dec 31, 2008 3:36 pm

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by Axolotl »

As I mentioned sometimes before I am a fan of AutoHotkey.
I use this workaround:
You only have to type: ;pb<SPACE> and voila.

Code: Select all

; AutoHotkey example to create the code-pb tags to the edit field in any editor/browser/etc. (Win only) 
; Caret is at the correct position to insert the code.
co:;pb::{[}code-pb{]}{[}{/}code-pb{]}{left 10}
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
User avatar
SPH
Enthusiast
Enthusiast
Posts: 561
Joined: Tue Jan 04, 2011 6:21 pm

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by SPH »

["code-pb"] should be default on forums!!
What's the point of having a black listing with ["code"]?
N O N E

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by AZJIO »

I have a js script that highlights the source code. When you use a code highlighting tag, it looks blurry to me. I wouldn't want it to be automatic. And then there will be a problem with old examples, some examples will be highlighted, while others will not. And the problem of choosing a code highlighting style is that what you like is not necessarily what everyone likes. For example, I have a black style using my own flowers, which I am used to.
PBJim
Enthusiast
Enthusiast
Posts: 293
Joined: Fri Jan 19, 2024 11:56 pm

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by PBJim »

SPH wrote: Wed Nov 06, 2024 3:07 pm ["code-pb"] should be default on forums!!
What's the point of having a black listing with ["code"]?
You are correct SPH, I had thought the same and it would seem to be better. I'm not sure though, since the forum is reliant upon phpBB, to what extent the button functions can be modified.

Anyway, your suggestion would be even better, I hope it might be considered.
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by Fred »

Last time I tried to make it default for code, it didn't worked, that why I added a specific pb tag.
User avatar
SPH
Enthusiast
Enthusiast
Posts: 561
Joined: Tue Jan 04, 2011 6:21 pm

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by SPH »

faudrait inverser les balises

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
PBJim
Enthusiast
Enthusiast
Posts: 293
Joined: Fri Jan 19, 2024 11:56 pm

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by PBJim »

SPH wrote: Thu Nov 07, 2024 12:37 pm faudrait inverser les balises
Oui, c'est encore mieux si c'est possible avec phpBB. Le texte noir simple n'est plus très attrayant maintenant, car nous sommes tous habitués aux surlignements colorés.
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: Simple IDE function to copy source with [code-pb] ... [/code-pb] included

Post by AZJIO »

very rarely, the code highlighting script broke the code. it was 2 times on a large code. I had to disable the script to copy the code. this is another reason why this could be a problem
Post Reply