PDA

View Full Version : Code formatting - please help!


jjs
02-18-2004, 06:28 AM
Hello all

I have recently got hold of 1st Page 2000 which I think is great! But I have a small problem...

1st Page applies colour coding to HTML, CSS, JavaScript, etc. to make it easy to read whilst developing - excellent. But when I use the LINK tag to import a CSS file from within an HTML file, I have to exclude the STYLE tags from the CSS file, and as soon as I do that, the colour coding no longer applies! (I have a similar problem with JavaScript when I use the SRC attribute within my SCRIPT tag to import a JavaScript file).

So how can I use the 1st page colour coding facilities within a CSS file or a JS file that doesn't include the STYLE or SCRIPT tags that would be there if the CSS or JS code was within the HTML directly?

Hope that question makes sense! Many thanks in advance for any help you all can give me.

Justin

thawebman
02-18-2004, 06:35 AM
then you have a problem

pascal
02-18-2004, 08:03 AM
thawebman, what are you doing?
Isn't that spam?
You made an extremely useless post.
Mod's, do something.


Anyway,
I got the same problem too, jjs.

What I do is that I just left the STYLE tags in the file, en right before saving, or publishing, remove the tags.

Or, you can use a CSS editor, like Top Style Lite. Those editors do have syntax highlighting for CSS, without the style tag.

azlatin2000
02-18-2004, 11:47 AM
I have the same problem. FP2k8 is supposed to fix this issue(if it even exists). CSS colorizing is almost totally useless for me though because it only has like three colors. I do need the js colorizing though.

pascal
02-19-2004, 07:51 AM
Ther is a colorizing for JS, but not when you have an external file.

azlatin2000
02-19-2004, 11:43 AM
I know that but the only types of javascripts i use are in external files because they are all about 10KB+ in size. And they are cached so the page loads faster.

GDS
02-19-2004, 12:30 PM
There is a simple solution to this problem.
Add this line on top of any css file:
/*<style> */



In similar manner add this on top of any js file:
//<script>


This trick makes 1st page 2000 use colors like in a html document.

GDS

pascal
02-20-2004, 05:07 AM
Yeah, that's totally right!

Thank you very much for the solution.

:D

Szara
02-21-2004, 08:33 AM
Excellent! I hadn't even known there was a solution to this problem. And now that I've got the answer, I don't have to ask, and will implement it right away. :D

Added: It's brilliant, and it's beautiful, and now I won't be able to resist fiddling around with my style sheets :p Thank you!!