Re: Smarty Syntax Highlighting File?



On Fri, 5 Aug 2011, Keith Roberts wrote:

To: mc gnome org
From: Keith Roberts <keith karsites net>
Subject: Re: Smarty Syntax Highlighting File?

On Fri, 5 Aug 2011, Keith Roberts wrote:

 To: mc gnome org
 From: Keith Roberts <keith karsites net>
 Subject: Smarty Syntax Highlighting File?

 I'm running Centos 5.6 and the version of mc is this:

 Name       : mc
 Arch       : i386
 Epoch      : 1
 Version    : 4.6.1a
 Release    : 35.el5

 I'm trying to learn how to use Smarty PHP Template Engine, to seperate
 the server sided logic from the browser display logic, using Smarty
 templates.

 I cannot see a syntax hightlighting file for Smarty code in the mc
 syntax directory. Has this been done yet?

 If not, how can I write my own Smarty syntax highlighting file please?

So if I write my own Smarty syntax file for mc, how do I tell mcedit to use this syntax file for a Smarty template file named guestbook1.tpl ?

The Smarty template files will begin with the following comment:

{* Smarty *}

OK. So I have found this post here:

http://mail.gnome.org/archives/mc-devel/2004-January/msg00068.html

followed the instructions in the file:

Smarty PHP template engine syntax for GNU Midnight Commander

Installation (suppose MC has syntax definitions in /usr/share/mc/syntax):

  1. Put the file smarty.syntax into /usr/share/mc/syntax

  DONE!

  2. Edit the file /usr/share/mc/syntax/Syntax
     Put the following block in front of first existing
     definition:

     file ..\*\\.(tpl|TPL)$ Smarty\sTemplate\sFile
     include smarty.syntax

There is no such file called 'Syntax' in the syntax directory. So I created a file calles Syntax in the syntax directory, and added those two lines, but when I open a *.tpl file, there is no syntax highlighting.

There is no Syntax file under my home dir ~/.mc/cedit/

There is a file called syntax.syntaxin /usr/share/mc/syntax, but when I add those 2 lines above:

     file ..\*\\.(tpl|TPL)$ Smarty\sTemplate\sFile
     include smarty.syntax

This causes a syntax error in that file.

So I have a smarty.syntax file now in /usr/share/mc/syntax, but I cannot seem to get mc to use it. Any suggs please how to get this working?

Kind Regards,

Keith Roberts

-----------------------------------------------------------------
Websites:
http: //www.karsites.net
http: //www.php-debuggers.net
http: //www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
_______________________________________________
mc mailing list
http://mail.gnome.org/mailman/listinfo/mc



--
-----------------------------------------------------------------
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]