HighDots Forums  

Code Coloring - plp

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Code Coloring - plp in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom
 
Posts: n/a

Default Code Coloring - plp - 07-05-2004 , 11:45 AM






I use PLP (http://plp.juerd.nl) so I can use perl inside my HTML, it
works in the same manner as PHP.

TO insert perl into my HTML I simple do the following:

<head>
</head>
<body>
<h1>my web page</h1>
<:
# Perl code goes here
my $test = "123";
print $test;
:>
</body>

I want Dreamweaver to color everything from the <: to the :> in a
color of my choice, but I am having a hard time even getting
Dreamweaver to even colour a .plp extension file for the HTML.

Any help would be appreciated and I have searched this and other
forums but nothing has come up with this specific problem.

Cheers,
Tom


Reply With Quote
  #2  
Old   
Randy Edmunds
 
Posts: n/a

Default Re: Code Coloring - plp - 07-05-2004 , 03:06 PM






Tom,

First, you will need to define a Perl doctype for DW. Define your
doctype in a separate file, as opposed to editing existing files. This
makes it much easier to port and you will never have to re-merge your
changes after an upgrade. Here’s a TechNote on doing that:

http://www.macromedia.com/support/dreamweaver/ts/documents/add_ext_mx.htm

Then take a look at the xml files in the Configuration/CodeColoring
folder. The Colors.xml file holds the color/style definitions, all the
others hold syntax definitions.

Create a new xml file for the syntax. I suggest starting with whatever
currently supported language has the syntax closest to Perl. Be sure to
make the ids unique to avoid conflicts. Use the doctype you just
created. Then edit the keywords, comment delimiters, etc. The
documentation is here:

http://www.macromedia.com/support/dreamweaver/extend/extensible_code_coloring/

You will need to setup the <blockStart>/<blockEnd> tag pairs for the
"<:" and ":>".

There are default colors for all the fields hard-coded in the C code. If
you don’t like them then you can create a colors file. You can use the
builtin editor to do this for you, but you’ll need to manually move the
xml from the Colors.xml file to your new file. Also, I suggest removing
the “docTypes” attribute so the colors...

When you get it working, then you can package it into an extension so
you can distribute it more easily and upload it to the Macromedia Exchange.

Hope this helps,
Randy



Quote:
I use PLP (http://plp.juerd.nl) so I can use perl inside my HTML, it
works in the same manner as PHP.

TO insert perl into my HTML I simple do the following:

head
/head
body
h1>my web page</h1
:
# Perl code goes here
my $test = "123";
print $test;
:
/body

I want Dreamweaver to color everything from the <: to the :> in a
color of my choice, but I am having a hard time even getting
Dreamweaver to even colour a .plp extension file for the HTML.


Reply With Quote
  #3  
Old   
Tom
 
Posts: n/a

Default Re: Code Coloring - plp - 07-05-2004 , 03:23 PM



Hi Randy,

Yes that does help me a lot, however I am in at the deep end I
feel...and Im struggling to keep a float

At the minute I just want my <: :> and everything in between to be in
a single colour and not visible when Im in design view. I have
managed to get the right colouring by adding the following lines:

<commentStart name="PLP" id="CodeColor_PLPCode"
scheme="innerText"><![CDATA[<:]]></commentStart>

<commentEnd><![CDATA[:>]]></commentEnd>

after the other comment tags at the top of the CodeColoring.xml file.

Now I am trying to hide it from the design view...is this possible?


I will expand this and everntually get a decent perl coloring system
in place but for now I want to take one step at a time...Im new to all
this

Cheers,
Tom



On Mon, 05 Jul 2004 12:06:15 -0700, Randy Edmunds
<randy_nospam (AT) macromedia (DOT) com> wrote:

Quote:
Tom,

First, you will need to define a Perl doctype for DW. Define your
doctype in a separate file, as opposed to editing existing files. This
makes it much easier to port and you will never have to re-merge your
changes after an upgrade. Here’s a TechNote on doing that:

http://www.macromedia.com/support/dreamweaver/ts/documents/add_ext_mx.htm

Then take a look at the xml files in the Configuration/CodeColoring
folder. The Colors.xml file holds the color/style definitions, all the
others hold syntax definitions.

Create a new xml file for the syntax. I suggest starting with whatever
currently supported language has the syntax closest to Perl. Be sure to
make the ids unique to avoid conflicts. Use the doctype you just
created. Then edit the keywords, comment delimiters, etc. The
documentation is here:

http://www.macromedia.com/support/dreamweaver/extend/extensible_code_coloring/

You will need to setup the <blockStart>/<blockEnd> tag pairs for the
"<:" and ":>".

There are default colors for all the fields hard-coded in the C code. If
you don’t like them then you can create a colors file. You can use the
builtin editor to do this for you, but you’ll need to manually move the
xml from the Colors.xml file to your new file. Also, I suggest removing
the “docTypes” attribute so the colors...

When you get it working, then you can package it into an extension so
you can distribute it more easily and upload it to the Macromedia Exchange.

Hope this helps,
Randy



I use PLP (http://plp.juerd.nl) so I can use perl inside my HTML, it
works in the same manner as PHP.

TO insert perl into my HTML I simple do the following:

head
/head
body
h1>my web page</h1
:
# Perl code goes here
my $test = "123";
print $test;
:
/body

I want Dreamweaver to color everything from the <: to the :> in a
color of my choice, but I am having a hard time even getting
Dreamweaver to even colour a .plp extension file for the HTML.


Reply With Quote
  #4  
Old   
Tom
 
Posts: n/a

Default Re: Code Coloring - plp - 07-06-2004 , 06:53 AM



Hi Randy,

Well I have read the documents you gave me and I feel that I can now
do what I need to do to make this work...

One thing however, how can I stop the coloured code from appearaing in
the design view window and give it a small yellow icon??

Cheers,
Tom


On Mon, 05 Jul 2004 12:06:15 -0700, Randy Edmunds
<randy_nospam (AT) macromedia (DOT) com> wrote:

Quote:
Tom,

First, you will need to define a Perl doctype for DW. Define your
doctype in a separate file, as opposed to editing existing files. This
makes it much easier to port and you will never have to re-merge your
changes after an upgrade. Here’s a TechNote on doing that:

http://www.macromedia.com/support/dreamweaver/ts/documents/add_ext_mx.htm

Then take a look at the xml files in the Configuration/CodeColoring
folder. The Colors.xml file holds the color/style definitions, all the
others hold syntax definitions.

Create a new xml file for the syntax. I suggest starting with whatever
currently supported language has the syntax closest to Perl. Be sure to
make the ids unique to avoid conflicts. Use the doctype you just
created. Then edit the keywords, comment delimiters, etc. The
documentation is here:

http://www.macromedia.com/support/dreamweaver/extend/extensible_code_coloring/

You will need to setup the <blockStart>/<blockEnd> tag pairs for the
"<:" and ":>".

There are default colors for all the fields hard-coded in the C code. If
you don’t like them then you can create a colors file. You can use the
builtin editor to do this for you, but you’ll need to manually move the
xml from the Colors.xml file to your new file. Also, I suggest removing
the “docTypes” attribute so the colors...

When you get it working, then you can package it into an extension so
you can distribute it more easily and upload it to the Macromedia Exchange.

Hope this helps,
Randy



I use PLP (http://plp.juerd.nl) so I can use perl inside my HTML, it
works in the same manner as PHP.

TO insert perl into my HTML I simple do the following:

head
/head
body
h1>my web page</h1
:
# Perl code goes here
my $test = "123";
print $test;
:
/body

I want Dreamweaver to color everything from the <: to the :> in a
color of my choice, but I am having a hard time even getting
Dreamweaver to even colour a .plp extension file for the HTML.


Reply With Quote
  #5  
Old   
Randy Edmunds
 
Posts: n/a

Default Re: Code Coloring - plp - 07-06-2004 , 12:00 PM



You'll need to define "<:" and ":>" as "ThirdPartyTags". Take a look in
the Configuration/ThirdPartyTags folder to see how this has been done
for the other Server Models.

Hint: create a new .xml file (as opposed to editing the existing one)
and place it in the same folder (except in your User Configuration
folder, not the Application Configuration folder) to make it much easier
to share your extension with others. Here's a TechNote:

http://www.macromedia.com/support/dreamweaver/ts/documents/multiuser.htm

HTH,
Randy


Quote:
how can I stop the coloured code from appearaing in
the design view window and give it a small yellow icon??


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.