Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Feature] Implement a feature equivalent to Syntax Higlight

Code of conduct, suggestions, and information on forums.debian.net.
Post Reply
Message
Author
User avatar
PsySc0rpi0n
Posts: 322
Joined: 2012-10-24 13:54
Location: Bitcoin World
Has thanked: 8 times
Been thanked: 1 time

[Feature] Implement a feature equivalent to Syntax Higlight

#1 Post by PsySc0rpi0n »

Hi...

As far as I know, in the Programming section, it is still not possible to have Syntax Highlight for programming languages. I think this could be a very useful feature when someone want to post a piece of code. Syntax Highlight makes the code way easier to read and if we use dark modes in the forum, the code is all in read with a dark background which makes it even harder to read, in my opinion.

I bet that this was already suggested by someone but I couldn't find anything in this sub-forum, so I created a new thread on the suject.

So, why don't we have that feature? Is it too hard to implement or this forum doesn't support it?

User avatar
mrnordio2
Posts: 26
Joined: 2023-03-29 14:53
Has thanked: 1 time
Been thanked: 6 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#2 Post by mrnordio2 »

Hello PsySc0rpi0n,

As you pointed out, the lack of syntax highlighting in programming forums can indeed make reading and understanding code more challenging, especially with dark mode themes.
While this feature isn't natively implemented in the forum, a temporary workaround could be to create a script, plugin, or browser extension that personalizes your experience.

As a Linux developer, you might be familiar with manipulating the Document Object Model (DOM) via JavaScript.
This approach allows you to alter the presentation of code in forum posts. For instance, you could develop a script that identifies code tags and applies syntax highlighting based on the programming language used.

Sharing such a script or plugin with the forum community could be a great way to assist other members facing the same issue. While a custom solution won't be visible to all forum users, it can significantly enhance your reading experience and that of others who are interested.

Implementing something akin to Markdown for syntax highlighting isn't overly complex, but it requires knowledge in JavaScript and an understanding of the specific forum's structure.
Personally, I often find copying the code into my own editor, where syntax highlighting is available, to be a practical workaround, but I recognize that having syntax highlighting directly in the forum would be a valuable addition.

I hope this suggestion is helpful, and I'm here to assist further if you have more questions or need additional guidance in developing this solution.

Best regards,
MrNordio
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel

User avatar
sunrat
Administrator
Administrator
Posts: 6511
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 489 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#3 Post by sunrat »

I just had a look in our admin control panel. There does not appear to be an option for syntax highlighting.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
PsySc0rpi0n
Posts: 322
Joined: 2012-10-24 13:54
Location: Bitcoin World
Has thanked: 8 times
Been thanked: 1 time

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#4 Post by PsySc0rpi0n »

@mrnordio2, unfortunately I have no knowledge whatsoever in JavaScript. I don't even consider myself as a Linux developer although I use to work with programming, but my skills are very limited.

If someone has any JavaScrpit knowledge, it would be awsome to see such add-on for this forum!

I found this very old post about syntax highlight in phpBB:
https://www.phpbb.com/community/viewtopic.php?t=2388331

Seems that it simply has no interest in the community, otherwise phpBB would support it already or someone would have already built a solution!


Edited;

Also found this:
https://github.com/s9e/phpbb-ext-highlighter

Would this one be useful?

CwF
Global Moderator
Global Moderator
Posts: 2719
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 201 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#5 Post by CwF »

Seems like this could be a browser plug-in, right click to open in context aware editor.

User avatar
donald
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 1106
Joined: 2021-03-30 20:08
Has thanked: 189 times
Been thanked: 248 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#6 Post by donald »

The pastebin feature does do the syntax highlighting but unfortunately that feature does not incorporate with the actual forum software.


app.php/pastebin/?mode=view&s=66
Typo perfectionish.


"The advice given above is all good, and just because a new message has appeared it does not mean that a problem has arisen, just that a new gremlin hiding in the hardware has been exposed." - FreewheelinFrank

User avatar
mrnordio2
Posts: 26
Joined: 2023-03-29 14:53
Has thanked: 1 time
Been thanked: 6 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#7 Post by mrnordio2 »

Hey PsySc0rpi0n and all,

Totally agree that a script, plugin, or even a browser extension could be a game-changer for reading code on the forum. It's clear how much easier it makes things, especially for those of us who live and breathe code.

Right now, my plate's pretty full with a bunch of projects, but I'm really into the idea of helping out with this. Building tools like these is right up my alley. Just gotta be upfront though, I'm juggling quite a bit at the moment.

I'm keen to dive into this when things ease up on my end. In the meantime, if anyone's itching to get started or has some ideas, I'm all ears and ready to chip in where I can. You know how it is – when we team up, we usually get things done faster and better.

I'll definitely keep an eye on this thread and jump in with both feet when I've got a bit more room on my schedule.
Excited to see where we can take this!

Catch you guys later.
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel

User avatar
donald
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 1106
Joined: 2021-03-30 20:08
Has thanked: 189 times
Been thanked: 248 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#8 Post by donald »

@mrnordio2 There is actually an unvalidated phpBB mod that can do this, but we are wary of installing it because it could potentially expose security holes in the forum. But if you could, please take a peek at it: https://github.com/s9e/phpbb-ext-highlighter
Typo perfectionish.


"The advice given above is all good, and just because a new message has appeared it does not mean that a problem has arisen, just that a new gremlin hiding in the hardware has been exposed." - FreewheelinFrank

User avatar
mrnordio2
Posts: 26
Joined: 2023-03-29 14:53
Has thanked: 1 time
Been thanked: 6 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#9 Post by mrnordio2 »

Thank you for pointing out the s9e/phpbb-ext-highlighter on GitHub.
It seems like a promising solution for adding syntax highlighting.
Safety is paramount, and it's wise to be wary of potential vulnerabilities.

I'll take a closer look at the extension, considering the security aspects you mentioned.
We'll enhance our forum's functionality while ensuring our community's digital safety.

Looking forward to exploring this further!
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel

User avatar
sunrat
Administrator
Administrator
Posts: 6511
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 489 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#10 Post by sunrat »

Maybe a Tampermonkey or Greasemonkey script would be a safer alternative and only needs to be installed by those who want it. There are several for other sites on GitHub which could be adapted.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

vng2022
Posts: 50
Joined: 2023-06-10 10:33
Has thanked: 1 time
Been thanked: 4 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#11 Post by vng2022 »

It is about 19th in a row AI generated reply during last five weeks made from one user account.

User avatar
mrnordio2
Posts: 26
Joined: 2023-03-29 14:53
Has thanked: 1 time
Been thanked: 6 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#12 Post by mrnordio2 »

vng2022 wrote: 2023-11-17 19:43 It is about 19th in a row AI generated reply during last five weeks made from one user account.
My response is almost what I would have said in my own words. I am here to assist those asking questions, not the AI platforms. The answers I provide, which offer multiple alternatives for solving problems, are even better than what I would have envisioned. I'm helping those in need, with good intentions, and I hope you are not bothered by the time I dedicate to helping others without expecting anything in return. You should be doing the same instead of posting criticisms with contempt and devaluing the time I spend reviewing each response.

In case any moderator, or administrator disagrees with my initiative and prefers that I am not here, just let me know and I will stop. Otherwise, I suggest that you focus more on your own life instead of monitoring how many responses, in what time frame, and from which account are being posted.

@sunrat
@donald
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel

User avatar
donald
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 1106
Joined: 2021-03-30 20:08
Has thanked: 189 times
Been thanked: 248 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#13 Post by donald »

I do not have any issues thus far with any posters as long as everyone behaves and is cordial to each-other. We don't all write the same language and for some users translators are a valid tool to make an attempt to speak in the forum primary language, lets give each other the benefit of the doubt until absolutely proven otherwise.
Typo perfectionish.


"The advice given above is all good, and just because a new message has appeared it does not mean that a problem has arisen, just that a new gremlin hiding in the hardware has been exposed." - FreewheelinFrank

vng2022
Posts: 50
Joined: 2023-06-10 10:33
Has thanked: 1 time
Been thanked: 4 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#14 Post by vng2022 »

mrnordio2 wrote: 2023-11-24 16:39 ... You should be doing the same instead of posting criticisms with contempt and devaluing the time I spend reviewing each response.
Thank you for the reply and explanation of your methods. As for your statement "posting criticisms with contempt and devaluing the time I spend" - there is nothing like that in my comment, it contains nothing except statement of fact, it was not my intention to imply something like that.
mrnordio2 wrote: 2023-11-24 16:39 Otherwise, I suggest that you focus more on your own life instead of monitoring how many responses, in what time frame, and from which account are being posted.
Please don't get personal pointing out on what I should focus on and what I should be doing .

User avatar
mrnordio2
Posts: 26
Joined: 2023-03-29 14:53
Has thanked: 1 time
Been thanked: 6 times

Re: [Feature] Implement a feature equivalent to Syntax Higlight

#15 Post by mrnordio2 »

vng2022 wrote: 2023-11-26 09:57
mrnordio2 wrote: 2023-11-24 16:39 ... You should be doing the same instead of posting criticisms with contempt and devaluing the time I spend reviewing each response.
Thank you for the reply and explanation of your methods. As for your statement "posting criticisms with contempt and devaluing the time I spend" - there is nothing like that in my comment, it contains nothing except statement of fact, it was not my intention to imply something like that.
mrnordio2 wrote: 2023-11-24 16:39 Otherwise, I suggest that you focus more on your own life instead of monitoring how many responses, in what time frame, and from which account are being posted.
Please don't get personal pointing out on what I should focus on and what I should be doing .
My intention in responding to various posts is to provide helpful and constructive solutions to the problems or questions raised by forum members. I aim to offer insights that are not only useful but also encompass a range of perspectives and options.

I understand your concern about the authenticity of the responses. Please rest assured that my contributions are made with the best intentions, focusing on aiding our community. I value the interaction and exchange of ideas in our forum, and my goal is to enrich these discussions with meaningful and relevant information.

Let's continue to work together in a spirit of cooperation and mutual understanding. If you have any further questions or concerns, please don't hesitate to share them.

If there's any specific aspect of my responses or any topic you'd like to discuss further, I'm more than happy to engage in a constructive dialogue. It's all about learning from each other and growing as a community.

:D
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel

Post Reply