Hi JoshyPHP s9e/highlighter looks great, I installed it on a board run by phpBB 3.2 and tried it but does not seem to work! What might be a problem?JoshyPHP wrote: Fri Jun 05, 2015 2:20 am 3.1 provides syntax highlighting for PHP (and only PHP) via highlight_string(), using the BBCode[code=php]
.
3.2 has no syntax highlighting in code blocks for any language. My recommendation is to use a JavaScript highlighter such as highlight.js or SyntaxHighlighter. My preference goes to highlight.js because it automatically detects the language of the source and it also requires one script tag to be installed. Both are available on various CDNs.
I don't know whether 3.2 should provide syntax highlighting at all. As far as I'm concerned, I wrote an extension for it to see how hard it would be to implement. All it takes is a script block in overall_footer to dynamically load highligher.js whererever needed. It costs 490 bytes per page. Unminified code here.
PHPBB3-13919 - Syntax highlighting in [code]
Re: PHPBB3-13919 - Syntax highlighting in [code]
Re: PHPBB3-13919 - Syntax highlighting in [code]
Can you provide instructions on how to use https://github.com/3D-I/code-prettify#h ... ed-as-code,3Di wrote: Sat Apr 22, 2017 3:52 am David, honestly I was looking at https://cdn.rawgit.com/google/code-pret ... rettify.js and I didn't see the 2013 on line 3 at the time I posted, my fault. The github link comes in handy, forked as well.
Well, I know the Joshyphp's extension already, but I am not completely satisfied of the results (not a Joshy's fault indeed).DavidIQ wrote: Sat Apr 22, 2017 3:15 am Honestly don't know why this is even being brought up anyways since there is a semi-official extension for syntax highlighting already:That's why.. https://github.com/3D-I/code-prettify#h ... ed-as-codehanakin wrote: Sat Mar 04, 2017 11:50 pm there are cases that could be made for code blocks that should be highlighted and others they should not
https://github.com/google/code-prettify, https://github.com/google/code-prettify ... started.md on phpBB 3.2?
Re: PHPBB3-13919 - Syntax highlighting in [code]
Hundreds, maybe thousands of things. If you post a link to your board that will narrow the scope.odf wrote: Wed Nov 22, 2017 8:24 am Hi JoshyPHP s9e/highlighter looks great, I installed it on a board run by phpBB 3.2 and tried it but does not seem to work! What might be a problem?
- 3Di
- Registered User
- Posts: 951
- Joined: Tue Nov 01, 2005 9:50 pm
- Location: Milano 🇮🇹 Frankfurt 🇩🇪
- Contact:
Re: PHPBB3-13919 - Syntax highlighting in [code]
Not really, I forked the repo in order to play with it and I haven't till now developped an extension for phpBB which uses it. To add, what stopped me to go ahead here has been the fact I read that's not so accurate with the PHP code.odf wrote: Wed Nov 22, 2017 8:36 amCan you provide instructions on how to use https://github.com/3D-I/code-prettify#h ... ed-as-code,3Di wrote: Sat Apr 22, 2017 3:52 am David, honestly I was looking at https://cdn.rawgit.com/google/code-pret ... rettify.js and I didn't see the 2013 on line 3 at the time I posted, my fault. The github link comes in handy, forked as well.
Well, I know the Joshyphp's extension already, but I am not completely satisfied of the results (not a Joshy's fault indeed).DavidIQ wrote: Sat Apr 22, 2017 3:15 am Honestly don't know why this is even being brought up anyways since there is a semi-official extension for syntax highlighting already:That's why.. https://github.com/3D-I/code-prettify#h ... ed-as-codehanakin wrote: Sat Mar 04, 2017 11:50 pm there are cases that could be made for code blocks that should be highlighted and others they should not
https://github.com/google/code-prettify, https://github.com/google/code-prettify ... started.md on phpBB 3.2?
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Re: PHPBB3-13919 - Syntax highlighting in [code]
You can try to use my extension. It should work on 3.1.x, but it should also work on 3.2.x
- 3Di
- Registered User
- Posts: 951
- Joined: Tue Nov 01, 2005 9:50 pm
- Location: Milano 🇮🇹 Frankfurt 🇩🇪
- Contact:
Re: PHPBB3-13919 - Syntax highlighting in [code]
Thanks for the interest.
We went to codemirror due to its power, as an example here's the rendered PHP with lines.
A grab from our extension's environment, in the future I will see to extract the code in order to make a separated extension from it.
. .
There in ACP the textarea has been limited on purpose.
We went to codemirror due to its power, as an example here's the rendered PHP with lines.
A grab from our extension's environment, in the future I will see to extract the code in order to make a separated extension from it.
. .
There in ACP the textarea has been limited on purpose.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Re: PHPBB3-13919 - Syntax highlighting in [code]
You should be asking that question in the support area for that extension
David
Remember: You only know what you know -
and you do not know what you do not know!
Remember: You only know what you know -
and you do not know what you do not know!