Syntax highlighter for web?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Syntax highlighter for web?

kintel
Administrator
Hi all,

I'm putting some more content on the openscad.org website (aka relaunch) and I'm looking for ways of syntax highlighting OpenSCAD scripts.
Looking around, prettify.js looks most widely used (https://code.google.com/p/google-code-prettify), but adding languages to it wasn't immediately intuitive to me.

Has anyone done this before, or are anyone up to the challenge of writing an .scad mode for prettify.js (or any other syntax highlighter) ?

Cheers,

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Syntax highlighter for web?

donbright
I have seen some in the Wiki... they are just using "source lang=javascript" (i.e. processing  scad as though it were javascript)


On Wed, Apr 17, 2013 at 12:07 AM, Marius Kintel <[hidden email]> wrote:
Hi all,

I'm putting some more content on the openscad.org website (aka relaunch) and I'm looking for ways of syntax highlighting OpenSCAD scripts.
Looking around, prettify.js looks most widely used (https://code.google.com/p/google-code-prettify), but adding languages to it wasn't immediately intuitive to me.

Has anyone done this before, or are anyone up to the challenge of writing an .scad mode for prettify.js (or any other syntax highlighter) ?

Cheers,

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Syntax highlighter for web?

kintel
Administrator
On 2013-04-17, at 07:40 , Don Bright wrote:

> I have seen some in the Wiki... they are just using "source lang=javascript" (i.e. processing  scad as though it were javascript)
>
> http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Conditional_and_Iterator_Functions
>
Hm, they use some kind of Mediawiki PHP plugin to do that. Not sure I want to go that route..
Prettify.js still looks like the best starting point.
It also looks like a bunch of people out there has been wanting this for blogs without finding any.

 -Marius
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Syntax highlighter for web?

Rob van Lopik

On 24-4-2013 3:41, Marius Kintel wrote:

> On 2013-04-17, at 07:40 , Don Bright wrote:
>
>> I have seen some in the Wiki... they are just using "source lang=javascript" (i.e. processing  scad as though it were javascript)
>>
>> http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Conditional_and_Iterator_Functions
>>
> Hm, they use some kind of Mediawiki PHP plugin to do that. Not sure I want to go that route..
> Prettify.js still looks like the best starting point.
> It also looks like a bunch of people out there has been wanting this for blogs without finding any.
>
>   -Marius
Just one other suggestion: Scintilla (www.scintilla.org). I thought of
it, because I know (and like) it from the Dolphin Smalltalk programming
environment. (Not for the Web, but maybe as external, or internal,  editor)

  -Rob van Lopik

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Syntax highlighter for web?

kintel
Administrator
On 2013-04-24, at 05:48 , Rob van Lopik wrote:
> Just one other suggestion: Scintilla (www.scintilla.org).

My original request was for _displaying_ openscad code on the web (for documentation/eductional purpose), not editing it.

But, yes QScintilla looks interesting for a potential GUI integration: http://www.riverbankcomputing.co.uk/software/qscintilla/intro

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566