This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-10-28 17:11:52

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

text synthax highlighting.

I was wondering is there a way to make a text highlighted to detect highlight code in colors, for example:

Code:

<?php and ?> would be orange
<div> and </div> would be red, etc

http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#2 2011-10-29 04:48:29

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: text synthax highlighting.

WindowsExplorer wrote:

I was wondering is there a way to make a text highlighted to detect highlight code in colors, for example:

Code:

<?php and ?> would be orange
<div> and </div> would be red, etc

i think a advanced text editor like VIM is what you are looking for (it highlights PHP syntax and many others)


http://i.imgur.com/1QqnHxQ.png

Offline

 

#3 2011-10-29 04:49:53

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: text synthax highlighting.

Or notepad ++


http://i.imgur.com/zeIZW.png

Offline

 

#4 2011-10-29 05:13:35

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: text synthax highlighting.

I mean a creator s you can make your custom color highlighting.


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#5 2011-10-29 07:46:30

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: text synthax highlighting.

WindowsExplorer wrote:

I mean a creator s you can make your custom color highlighting.

Though by your name I can guess you don't have a Mac, the Mac package Xcode allows syntax highlighting for many languages, including HTML, JS, CSS, PHP, C, C#, C++, Obj-C, etc.
EDIT: Dashcode is Web-specific. And not very scary, like Xcode.

Last edited by Hardmath123 (2011-10-29 08:03:32)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6 2011-10-29 11:58:21

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: text synthax highlighting.

He doesn't want a syntax highlighted text editor. He want to PROGRAM one and is wondering how. All I can say it that you need to scan the text for tags and highlight them.

EDIT: 1000th post.  big_smile

Last edited by MathWizz (2011-10-29 12:25:22)


http://block.site90.net/scratch.mit/text.php?size=30&amp;text=%20A%20signature!&amp;color=333333

Offline

 

#7 2011-10-29 17:40:26

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: text synthax highlighting.

MathWizz wrote:

He doesn't want a syntax highlighted text editor. He want to PROGRAM one and is wondering how. All I can say it that you need to scan the text for tags and highlight them.

EDIT: 1000th post.  big_smile

Great.  big_smile  Your almost up to- never mind.  tongue

One way is to use jQuery. I thought there was a wrap() function, but I couldn't find it. So you can use append and prepend.  You can insert font tags and add color attributes to it.  smile

Offline

 

Board footer