Code syntax support?

Code syntax support?

Postby XndrK » Tue May 13, 2014 6:53 pm

I know there is already Perl code support built in to phpBB, but Python isn't Perl. Not by a long shot.

To address the issue, I looked up phpBB addons and found this.
stranac, can you install this or (somehow) contact jkbbwr if you can't?

Code: Select all
print("This doesn't work.") 
Proverbs 26:14 describes me a bit too well.

Version: Python 2.7.5

https://github.com/4of92000
https://github.com/PythonForum/
User avatar
XndrK
 
Posts: 172
Joined: Sat Jun 15, 2013 7:57 pm

Re: Code syntax support?

Postby stranac » Tue May 13, 2014 6:59 pm

I can't do it, and my chances to get in contact with Jakob are about as good as anyone else's.
You can try talking to him in IRC, that's what I usually do (although he's not around all that often).
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1144
Joined: Thu Feb 07, 2013 3:42 pm

Re: Code syntax support?

Postby XndrK » Tue May 13, 2014 7:00 pm

Yeah, I could build a chatbot that asks once every 5 minutes, but I think that everyone else on the channel will go insane.

Let's nix that idea.
Proverbs 26:14 describes me a bit too well.

Version: Python 2.7.5

https://github.com/4of92000
https://github.com/PythonForum/
User avatar
XndrK
 
Posts: 172
Joined: Sat Jun 15, 2013 7:57 pm

Re: Code syntax support?

Postby stranac » Tue May 13, 2014 7:26 pm

Well, he's talking in #python right now, so getting in touch with him probably wouldn't be too hard...
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1144
Joined: Thu Feb 07, 2013 3:42 pm

Re: Code syntax support?

Postby micseydel » Tue May 13, 2014 8:37 pm

XndrK wrote:Yeah, I could build a chatbot that asks once every 5 minutes, but I think that everyone else on the channel will go insane.

You could have it chat him when you notice he is active, and ping him at intervals much larger, without any harm.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1369
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Code syntax support?

Postby XndrK » Tue May 13, 2014 9:55 pm

Great idea!

Libpurple has a Python API, right?
Proverbs 26:14 describes me a bit too well.

Version: Python 2.7.5

https://github.com/4of92000
https://github.com/PythonForum/
User avatar
XndrK
 
Posts: 172
Joined: Sat Jun 15, 2013 7:57 pm

Re: Code syntax support?

Postby Kebap » Wed May 14, 2014 8:56 am

Agree, this would be a nice feature to have.
Learn: How To Ask Questions The Smart Way
Join the #python-forum IRC channel on irc.freenode.net and chat with uns directly!
Kebap
 
Posts: 396
Joined: Thu Apr 04, 2013 1:17 pm
Location: Germany, Europe

Re: Code syntax support?

Postby metulburr » Wed May 14, 2014 10:06 am

Agree, this would be a nice feature to have.

+1
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1470
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Code syntax support?

Postby stranac » Wed May 14, 2014 3:14 pm

I might as well share my code highlighting userscript...
It's far from perfect, it highlights stuff other than python code and such, but it's kinda useful, since the forum doesn't have the feature.
I first used something like this for code highlighting in a forum for an edX course, and modified it for a few sites since then.

I uploaded the script and the used css to github (was gonna upload to userscripts.org, but it doesn't seem to be responding).
You can find the script here.
It was made for use with my dark theme, but it seems to look ok with the default one as well.

I only used this with scriptish on firefox, but it might work with other user script engines.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1144
Joined: Thu Feb 07, 2013 3:42 pm

Re: Code syntax support?

Postby XndrK » Wed May 14, 2014 11:23 pm

It works with Greasemonkey (also on Firefox) as well.

Yay!
Proverbs 26:14 describes me a bit too well.

Version: Python 2.7.5

https://github.com/4of92000
https://github.com/PythonForum/
User avatar
XndrK
 
Posts: 172
Joined: Sat Jun 15, 2013 7:57 pm

Re: Code syntax support?

Postby micseydel » Thu May 15, 2014 12:24 am

I couldn't get it to work with Tampermonkey on Chrome D=

Thanks for sharing it though!
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1369
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Code syntax support?

Postby mckryall » Tue May 27, 2014 4:45 am

It works for me with Tamperonkey, also on Chrome. Ubuntu 14.04, 64bit
Python 2.7
Mac Mini
Laptop w/ Ubuntu 14.04
Steam; PSN
mckryall
 
Posts: 94
Joined: Sat Nov 23, 2013 6:13 pm

Re: Code syntax support?

Postby metulburr » Tue May 27, 2014 10:55 am

interesting.

I know what should be different colors, but i have to squint to really see it. I seem to have a problem differentiating the different colors with that setup. Is there a way to change the colorscheme?
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1470
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Code syntax support?

Postby stranac » Tue May 27, 2014 12:15 pm

Well, this line of the script tells it where to download the css from:
Code: Select all
// @resource       PrettifyCSS https://raw.githubusercontent.com/stranac/misc/master/python-forum-code-dark.css

You can change that url to wherever your prefered style is. Probably will require deletion and reinstallation of the script.

Another option is just editing the file it downloads.
It should be somewhere in the firefox profile (if using firefox ofc)
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1144
Joined: Thu Feb 07, 2013 3:42 pm


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests