Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-02-06 20:24:38
- manastojones
- Member
- Registered: 2009-04-13
- Posts: 14
[contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
Not sure where to really place this topic so I’ll do it here.
I started working on a TextPattern Syntax mode file for Coda and SubEthaEdit last week and finally got a pretty good version of it up and running. For those of you who use either of these two programs for editing you’re template files, I’m sure this will help a ton when trying to spot txp:tags in your html.
You can find the github repo here.
Anyway, here’s what it does:
- Automatically recognizes txp:tags for files with an extension of .txp.
- Keeps all normal highlighting for normal HTML syntax.
- Matches all standard txp:tags with a fallback for matching plugin tags and so on.
- Matches txp:php tags and uses PHP syntax highlighting for code found inside.
- Recognizes txp:tags inside attribute parameter strings, which I think is the killer feature.
Here’s what it doesn’t do:
- Autocompletion. It may work, it may not, but I really have no idea how to handle this functionality.
There are some other things I’d like to get working, but for now, I just wanted anyone who might be interested in working on it to know that it is there. I’ll figure out a way for you to get in touch with me if you’re interested.
Last edited by manastojones (2010-02-06 20:34:25)
Offline
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
This is awesome! I’m gonna try it out now.
Thanks
Admin Themes Prometheus | Stung | <txp:coder/
My Portfolio | ɹǝpuɐz.com | @MrMartineau
<txp:coder /> – Convert your designs into Textpattern-based websites
jQuery Style | @jquerystyle
Offline
#3 2010-02-15 02:35:49
- manastojones
- Member
- Registered: 2009-04-13
- Posts: 14
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
Awesome.. let me know what you think, if it was easy to get working or not.
Offline
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
Nice idea: I put the entire .mode folder in the ~user/Library/Application Support/Coda/Modes
folder and the Textpattern Syntax Mode is available in the Syntax Mode list under the Text menu. That’s great.
- Can I change the colours myself? For me, they’re too close to the other colours (e.g. txp is a green similar to the html comments, the txp:function is very similar to the HTML attribute name colour) and I find them hard to differentiate at a glance. More contrast for better scanability of the code would help. As far as I am concerned, the txp: and the function could have the same/near-identical colouring.
- Is it possible for the txp:tags to be recognised in the code navigator ( {}-button bottom left of window)?
Recognizes txp:tags inside attribute parameter strings, which I think is the killer feature
That’d be excellent. It worked for me within attribute parameter strings of txp-functions (tag in tag) but I don’t see it working in html attributes, for example the following didn’t show:
<link rel="stylesheet" href="<txp:css />" type="text/css" media="screen" />
<script type="text/javascript" src="<txp:site_url />js/swfobject.js"></script>
I don’t see autocompletion working although you do have the AutocompleteAdditions.txt
set up. Not sure why it doesn’t respond to a “txp:” trigger but that feature would really be awesome.
i think it’s a great idea and hope the feedback is of help.
TXP Builders – finely-crafted code, design and txp
Offline
#5 2010-02-18 15:21:47
- manastojones
- Member
- Registered: 2009-04-13
- Posts: 14
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
You should be able to change the colors yourself after you install the mode. I just set the default colors to the ones best suited for my setup (i.e. Comments are grey in my code).
Also, <txp:tags/> in html attributes is something I could probably get working the next time I sit down and fiddle with it a little bit.
Last thing, AutocompletionAdditions.txt is there because I just figured I’d at least have it incase it decided to work magically. Other than that, I don’t know how to get auto completion up and running.
Thanks for the feedback… I’ll post when I update the repo.
Offline
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
Awesome indeed! Thanks Braden.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
Just found this and it would be very useful for me, but I’ve only got it half-working. I’ve installed the .mode folder in ~user/Library/Application Support/Coda/Modes, and textpattern is now showing in the preferences->colors->languages.
The colouration can be done manually be choosing ‘textpattern’ from the coda text menu’s syntax modes, but is not being applied automatically to files with .txp file extensions. Any idea how I can get that working?
Are you still planning on progressing with this project? Hope so.
Offline
#8 2010-08-24 15:02:53
- manastojones
- Member
- Registered: 2009-04-13
- Posts: 14
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
Phil,
I am still working on this project. It’s kind of on the backburner, but I do have plans to continue with it when I get a chance.
Recognizing the .txp should be an easy fix. I thought I had it working, but maybe I took it out for some reason (?).
If you’re interested, I’m completely open to help on the project. I don’t know much about .mode files other than what I already have working.
Fork the repo if you want: http://github.com/manastojones/TextPattern.mode
Last edited by manastojones (2010-08-24 15:03:26)
Offline
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
Hello again,
I did get it to auto-recognise files with .txp filenames in the end, simply changing the current forms’ .html extensions to .txp did not work – but any new files with .txp worked fine – so simply copied and pasted into new files. A bit strange but all working great now.
Offline
#10 2010-09-08 14:00:12
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
This is great!
I was just trying to decide what IDE to use and now CODA seems the right choice.
Offline
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
Very useful indeed. Although I had some trouble with the auto-complete function.
To fix that I built an alternate AutocompleteAdditions.txt
Replace the one in the Resources folder. (Make sure to keep a copy of the original file, if this isn’t working for you!)
Thanks to manastojones again!
Cheers,
mjut
—-> Phil got the new <—-
Last edited by mjut (2011-09-16 07:28:20)
Offline
Re: [contrib] TextPattern Syntax Mode for Coda and SubEthaEdit
manastojones and mjut, thank you – this is a real timesaver :-)
Offline