jboffel / smartypdt

Automatically exported from code.google.com/p/smartypdt
0 stars 0 forks source link

No possibility to change default delimeter? And extension? #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello in many cases I'm forced to use diffrent delimeter in smarty templates.
For example '<{' and '}>'. I didn't found possibility to change them.

Second thing. Is there possible to change default extensions from .tpl to
example .html? Or use them both?

Original issue reported on code.google.com by arve...@klecza.pl on 10 Jan 2008 at 8:27

GoogleCodeExporter commented 9 years ago
I need the same ability to change the smarty delimiter, and I'm a do-it-yourself
kinda person, so I got the latest from SVN trunk.

first had to fix a bug:
in: (in plugin package explorer tree):
 org.eclipse.php.smarty.ui/src/org.eclipse.php.smarty.ui.editor.configuration/SmartyStructuredTextViewerConfiguration.java

Changed line:
import org.eclipse.php.internal.ui.preferences.util.WeakPropertyChangeListener;
To:
import org.eclipse.php.internal.core.util.WeakPropertyChangeListener;

(since it could not find the original location, I found where it did exist)

Then, to change the delimiter I tried changing the file SmartyTokenizer.jflex 
but
when I try to generate the file with jflex it keeps giving me errors about the
skeleton file, and if I don't use the skeleton file it's missing needed parts 
of the
class so the java build fails...  I think it's because I'm using JFlex version 
1.4.1
and the skeleton and jflex files are using JFlex version 1.2.2 (which I can't 
find
anywhere, version 1.4.1 was released back in 2004).

I guess the question/issue is, can you provide a copy of the JFlex binaries you 
used,
or any chance you can update the tokenizer to use the latest version of JFlex 
1.4.1?
 Or, best case scenario, is if you changed it so that the delimiter can be changed in
a config file somewhere...

Also, is this open to community contributions or is it still closed at this 
point?

Original comment by ohhe...@gmail.com on 14 Jan 2008 at 10:22

GoogleCodeExporter commented 9 years ago
I've got it to show the settings for smarty delimiters in the config pages.  
I've
gotten it to work with the starting smarty delimiter.

Making the end smarty delimiter actually work for syntax highlighting is the 
part
that is giving me trouble.  Should I commit what I've done so far to see if 
someone
else wants to take a crack at it, or just wait till I can come up with a 
solution for
the end delimiter?

Original comment by ohhe...@gmail.com on 29 Jan 2008 at 11:55

GoogleCodeExporter commented 9 years ago
Can you post the diff file here? Maybe we should wait till we have a complete 
solution (since most of the users set both start and end delimiters). 

Also maybe someone can help you with the end delimiter, so once you attach the 
diff 
file it will be someone's starting point...

Bests,

Original comment by ganoro on 30 Jan 2008 at 5:16

GoogleCodeExporter commented 9 years ago
Do you mind if I only commit the changes to the SmartyTokenizer.jflex, 
skeleton.sse,
and SmartyTokenizer.java, since the changes are self-contained in those files?

I wanted to commit it because of another minor bug fix mixed in there.  There 
is a
bug where text before the smarty tag is sometimes marked as a smarty delimiter,
resulting in the text being red (or whatever color is used for smarty 
delimiters).

Attached are the diffs for the UI and the core projects, what I would commit 
would
only be the files I said above, not all of the files changed in the diff.

Original comment by ohhe...@gmail.com on 11 Feb 2008 at 2:02

Attachments:

GoogleCodeExporter commented 9 years ago
Go a head, well done! (BTW - you are more than welcome to commit anytime you 
need, I 
will see the changes in my daily update)

Thanks!

Original comment by ganoro on 11 Feb 2008 at 5:33

GoogleCodeExporter commented 9 years ago
Good job guys. Thnak you a lot. Waiting for commit.

Original comment by arve...@gmail.com on 13 Feb 2008 at 9:55

GoogleCodeExporter commented 9 years ago
Commited changes for the Tokenizer end of it, but like mentioned before, the end
delimiter is not yet able to be changed.  I'll keep working on it but I think it
needs a new pair of eyes (or a pair of eyes more familiar with tokenizers and 
parsers)

Next step:  In SmartyTokenizer, see the line:

    public static String smartyRightDelim = "}";

The goal:  make it so that you can change the line mentioned above to change 
what the
end delimiter is, and no other changes elsewhere on the file are needed in 
order to
have that used as the end delimiter.  It will probably take some sort of 
customized
scanner, I'm thinking something that works like the PHP start and end tags
scanners...  any ideas?

Original comment by ohhe...@gmail.com on 14 Feb 2008 at 4:02

GoogleCodeExporter commented 9 years ago
Any update on being able to change the delims?

Original comment by jcval...@gmail.com on 29 Jul 2008 at 8:44

GoogleCodeExporter commented 9 years ago
Not much since that last comment.  It will take someone with more experience 
with
tokenizers than I.

Original comment by ohhe...@gmail.com on 30 Jul 2008 at 3:54

GoogleCodeExporter commented 9 years ago
Any update about extension ?
i'm using Smarty with .tpl.html extension :/

Original comment by Azrie...@gmail.com on 9 Sep 2008 at 12:39

GoogleCodeExporter commented 9 years ago
Any progress on this?  It's coming up on a year, and this would be handy, as the
parser won't even open one of my files that is used to generate a PHP file (I 
know, I
know, it's not what Smarty was designed for, but it's better than trying to 
generate
a PHP file with PHP!)

Original comment by cincoden...@gmail.com on 3 May 2009 at 4:44

GoogleCodeExporter commented 9 years ago
Can this feature be placed in regular Preferences ?

Original comment by mikol...@gmail.com on 10 Dec 2009 at 2:59

GoogleCodeExporter commented 9 years ago
vote for diffrent delimeter

Original comment by Slavi...@gmail.com on 20 Sep 2010 at 9:24

GoogleCodeExporter commented 9 years ago
I't very high priority... (
All good work, but this... (

Original comment by realtor3...@gmail.com on 24 Oct 2010 at 12:13

GoogleCodeExporter commented 9 years ago
I use {< and >}

Original comment by albr...@gmail.com on 4 Mar 2012 at 11:38

GoogleCodeExporter commented 9 years ago
+1 vote. 4 years past first being reported and still of relevance to people. My 
team uses {% %}. 

Original comment by mark.eij...@gmail.com on 7 Mar 2012 at 9:17