Page 1 of 1

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

Posted: Tue Nov 05, 2024 6:01 am
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.

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

Posted: Tue Nov 05, 2024 6:35 am
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 ?

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

Posted: Tue Nov 05, 2024 8:06 am
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.

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

Posted: Tue Nov 05, 2024 8:40 am
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.

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

Posted: Tue Nov 05, 2024 4:06 pm
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}

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

Posted: Wed Nov 06, 2024 3:07 pm
by SPH
["code-pb"] should be default on forums!!
What's the point of having a black listing with ["code"]?
N O N E

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

Posted: Wed Nov 06, 2024 4:38 pm
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.

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

Posted: Wed Nov 06, 2024 6:28 pm
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.

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

Posted: Thu Nov 07, 2024 10:08 am
by Fred
Last time I tried to make it default for code, it didn't worked, that why I added a specific pb tag.

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

Posted: Thu Nov 07, 2024 12:37 pm
by SPH
faudrait inverser les balises

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

Posted: Thu Nov 07, 2024 3:00 pm
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.

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

Posted: Thu Nov 07, 2024 5:49 pm
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