[ABD] Prism JS syntax highlighter ⚡️

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
munair
Registered User
Posts: 8
Joined: Sat Dec 18, 2021 10:43 am

Re: [3.3][4.0][RC] Prism JS syntax highlighter ⚡️

Post by munair »

FOUND IT!

I looked at other themes such as coy.css and copied the "div.code-toolbar" definitions starting at line 257 to the sharpbasic theme. That did the trick. I generated my theme online (http://k88hudson.github.io/syntax-highl ... rator/www/) but it did not include the necessary code for displaying the language and copy items at the upper right corner.

This is the code I copied

Code: Select all

div.code-toolbar {
	position: relative;
}

div.code-toolbar > .toolbar {
	position: absolute;
	top: .3em;
	right: .2em;
	transition: opacity 0.3s ease-in-out;
	opacity: 0;
}

div.code-toolbar:hover > .toolbar {
	opacity: 1;
}

/* Separate line b/c rules are thrown out if selector is invalid.
   IE11 and old Edge versions don't support :focus-within. */
div.code-toolbar:focus-within > .toolbar {
	opacity: 1;
}

div.code-toolbar > .toolbar > .toolbar-item {
	display: inline-block;
}

div.code-toolbar > .toolbar > .toolbar-item > a {
	cursor: pointer;
}

div.code-toolbar > .toolbar > .toolbar-item > button {
	background: none;
	border: 0;
	color: inherit;
	font: inherit;
	line-height: normal;
	overflow: visible;
	padding: 0;
	-webkit-user-select: none; /* for button */
	-moz-user-select: none;
	-ms-user-select: none;
}

div.code-toolbar > .toolbar > .toolbar-item > a,
div.code-toolbar > .toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar > .toolbar-item > span {
	color: #bbb;
	font-size: .8em;
	padding: 0 .5em;
	background: #f5f2f0;
	background: rgba(224, 224, 224, 0.2);
	box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
	border-radius: .5em;
}

div.code-toolbar > .toolbar > .toolbar-item > a:hover,
div.code-toolbar > .toolbar > .toolbar-item > a:focus,
div.code-toolbar > .toolbar > .toolbar-item > button:hover,
div.code-toolbar > .toolbar > .toolbar-item > button:focus,
div.code-toolbar > .toolbar > .toolbar-item > span:hover,
div.code-toolbar > .toolbar > .toolbar-item > span:focus {
	color: inherit;
	text-decoration: none;
}
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [3.3][4.0][RC] Prism JS syntax highlighter ⚡️

Post by 3Di »

munair wrote: Sat Dec 18, 2021 12:41 pm I looked at other themes such as coy.css and copied the "div.code-toolbar" definitions starting at ...
See how-to: Create a new language definition

Prism JS does not support Sharp Basic ATM, therefore please refere to their site since this extension simply implements Prism.js in phpBB.
munair wrote:Below the code box there are two "toolbar-items" showing
There is only one theme which may have those 2 below the codebox, all the others have them on the top-right side of the codebox, therefore that's not a bug in this extension. Try other themes provided by this extension (ACP) and you will see what I mean.

Image
Last edited by 3Di on Sat Dec 18, 2021 8:59 pm, edited 1 time in total.
🆓 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. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
munair
Registered User
Posts: 8
Joined: Sat Dec 18, 2021 10:43 am

Re: [3.3][4.0][RC] Prism JS syntax highlighter ⚡️

Post by munair »

3Di wrote: Sat Dec 18, 2021 8:24 pm Prism JS does not support Sharp Basic ATM, therefore please refere to their site since this extension simply implements Prism.js in phpBB.
Adding support for SharpBASIC syntax wasn't the problem. I added prism-sharpbasic.js and prism-sharpbasic.min.js based on the many languages that are shipped with Prism. The problem was in the theme css file, which I was able to solve. But it took me a while to figure out what the problem was. Syntax highlighting works fine now on the SharpBASIC forum.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [3.3][4.0][RC] Prism JS syntax highlighter ⚡️

Post by 3Di »

I'm happy that you solved your problem, I hope that it will be implemented (so proposed) by Prism.js so that we can update this extension if necessary (Not sure, we autoload languages not present in our basic configuration - see first post).

I would like to reiterate that this is a problem (if it can be called such) that does not concern our extension.

Moreover, I've added a note about your primary problem ("toolbar-items"), which you may have missed.
🆓 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. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
munair
Registered User
Posts: 8
Joined: Sat Dec 18, 2021 10:43 am

Re: [3.3][4.0][RC] Prism JS syntax highlighter ⚡️

Post by munair »

3Di wrote: Sat Dec 18, 2021 8:52 pm Moreover, I've added a note about your primary problem ("toolbar-items"), which you may have missed.
Thank you for adding the note. I read it. I would like to add that I was also able to create regex rules for SharpBASIC comments, both single (') and multi-line (/'..'/) by looking at the vb.net and c-like javascript files. It's great that Prism has so many example languages to choose from.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [3.3][4.0][RC] Prism JS syntax highlighter ⚡️

Post by 3Di »

I too think prism.js is outstanding if not the best in its class. :)
🆓 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. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
torzdf
Registered User
Posts: 1
Joined: Fri Aug 12, 2022 9:34 am

Re: [3.3][4.0][RC] Prism JS syntax highlighter ⚡️

Post by torzdf »

Edit: I was being an idiot. Your real name is in your profile here on PHPBB. I will leave the message in case anyone else has this problem.

Original post
-----------------

First up, many thanks for taking the time to create this very useful extension.

I would like to try it out on my board, however I am having a problem creating an account on your forum to download the extension. I accept that there is a very high probability that I am being an idiot here. When creating an account, spam protection asks:
What's the admin's real name in reverse?
Now, I have tried variations of your username which (unsurprisingly) did not work. I have had a poke around the site to see if I could find your real name, but drew a blank

I'm doing something stupid, aren't I? Either way, how can I find the answer to this question. I assure you I am not a robot!
Last edited by torzdf on Fri Aug 12, 2022 9:50 am, edited 1 time in total.
php90
Registered User
Posts: 16
Joined: Thu Jan 12, 2012 9:36 am

Re: [3.3][4.0][RC] Prism JS syntax highlighter ⚡️

Post by php90 »

Hello

is it a paid script now ?

Thank you
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28619
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: [3.3][4.0][RC] Prism JS syntax highlighter ⚡️

Post by Paul »

This topic has been marked as [ABD] - Abandoned as the extension author has been banned. If the extension author wishes to continue development, please PM anyone on the Extension Customisations Team to request this topic be unlocked.

Notice!
We do not recommend that a user of the phpBB software install this extension, or any other extension that is marked as "abandoned" or "in development", on a live forum. Doing so may cause your forum to not perform in the manner it should.


Thank you,
The phpBB Extension Customisations Team
Locked

Return to “Abandoned Extensions”