Page 1 of 1

On the verge

Posted: Wed May 14, 2008 9:22 pm
by edjay
Hi Textpad Forums!

I installed an evaluation version of 5.2.0, 32 bit edition a few days ago. My HTML syntax highlighting is looking great, I go to:

Configure > Preferences > Document Classes > Colors/Fonts/Syntax

...and I have set up my first scheme, which Textpad remembers: Everything looks spot on!

When I come to do the same with CSS, I am struggling to find a way to change most of the colours?

At the moment, li { a { etc , url( and contents ) semi-colons, class and id, values like serif, center, green are all the same colour? ( EDit: To add : I can change strings, comments and numbers, but everything else changes with the text.)

Could anyone please tell me if this is because of the evaluation version, or is this a case of beginners-Duuh?

Much appreciated. All the best! :)

Posted: Thu May 15, 2008 8:12 am
by Cloink
The HTML language is already set up for you when you install TP. CSS is not.

If you need CSS to have its own syntax highlighting (I just include mine as part of my javascript 'Document Class'), you need to set up a Document Class especially for it.

Configure > Preferences > Document Classes. Then follow TP's own help.

Instead of writing your own syntax definition file (i.e. a file that defines all the css keywords), look for a ready-made css one here:-
> http://www.textpad.com/add-ons/syna2g.html

Posted: Thu May 15, 2008 8:50 am
by edjay
Giving that a go now. Many thanks! :)

Posted: Thu May 15, 2008 2:14 pm
by edjay
Success! I've gone for the Patric Sperling contribution from 2001.

As another Q:

Is there any way to add #id and .class to this list? :?:

Posted: Thu May 15, 2008 3:11 pm
by Cloink
#id and .class?

You mean any and all '#id's and '.class'es? If I've understood you correctly, no - it can only recognise keywords, not patterns.

If you have common element-ids such as, literally, '#id', then you can add, literally, '#id' (and any others) to the .syn file you downloaded (then close & reopen TP).

If you do this, I would recommend putting any of 'your' #element-id names in their own Keyword list and highlighting them in a different colour to genuine css reserved words.

I don't think TP will have a problem with special characters as the first.

Posted: Thu May 15, 2008 11:33 pm
by edjay
Hi Cloink!

I think I see what you mean about personalised names. I was more thinking that if the # sign was used as per normal for:

Code: Select all

 <div id="hozmain">

Code: Select all

#hozmain { parameters etc } 
...that the word "hozmain" would be highlighted. Similarly with

Code: Select all

<div class="vertlist">

Code: Select all

.vertlist { parameters etc }
I don't think I'll worry about it too much, but I will try and get myself clearer on the relevant coding lingo. :roll:

I like the software and I'm happy with the evaluation so I'll sign up next week. Could I just ask: If I buy an official CD, will it be properly presented or just a plain burned-off copy?

---> I found out about TP as it is recommended by Steven M. Schafer in his "Web Standards" (2005) which I've just started reading.

Thanks very much for your help Cloink! :)

Posted: Fri May 16, 2008 9:04 am
by Cloink
There is no CD, you just pay your money and get a license key to apply to your evaluation version - no re-install - so everything you've set up stays the same.

There are other posts in these forums asking for more powerful syntax highlighting capabilities so if Helios are listening(reading) and you're lucky, you may one day be able to syntax-highlight in the way you want, but not at the moment.

TP seems to be recommended in lots of places - I have a 'Dummies' web programming book that mentions it too.

I believe there are other text editors out there to rival TextPad (I've never found the need to try any others), but I doubt there are any that are significantly better at the all-round job.

Posted: Fri May 16, 2008 9:20 am
by edjay
Ok, I'll catch up with registration next week. Thanks again! :)