DeeEmm

Pragmatism in code

Syntax highlighting code in TinyMCE

After a recent tutorial a member mailed me to let me know that the code snippets were not displaying correctly. A quick look told me that this was due to my use of the pre tag, which prevented the text from breaking when it reached the bounds of it's containing element.

The fix was relatively easy - add the following hacks to force the text to wrap for pre formatted text...

word-wrap: break-word; /* Internet Explorer 5.5+ */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ white-space: pre-wrap; /* css-3 */

But this got me thinking, and jarred my memory to something I was working on a little while back.

I had previously taken a look at syntax highlighting for WYSIWYG editors, this was for use in the DMCMS project where i wanted to allow full editing of template files from within the Admin panel. This is something that I had implemented on an earlier development version but had then abandoned. (For some reason that i can no longer remember)

Continue reading
  6970 Hits
  0 Comments
6970 Hits
0 Comments

Coda - Web Code The Mac Way

http://www.panic.com/images/major4-3.gif

 

It's been a long time since I switched from using Windows as my primary development platform, and whilst you may hear a fair bit about the effect that this has had within my posts (for better or worse). Something that i have never really been able to completely replace on either the Mac or Linux platform was my favoured editor - Ultraedit. Deep down I have a soft spot for Uedit, and whilst it can be a little bloated for simple tasks, years of useage and tweaking to my liking made it my favourite tool for all kinds of development work.Gedit on the Linux platform, once endowed with a few useful plugins, becomes a useable tool for web development. The inclusion of tools such as the 'Class Browser' (http://www.stambouliote.de/projects/gedit_plugins.html), 'Symbol Browser' (http://symbol-browser.sourceforge.net), 'Word Completion' (http://users.tkk.fi/~otsaloma/gedit) and 'Find in Files', makes Gedit a really useful editor, which whilst not really feature packed is more than capable, which is excellent for the standard packaged editor that is supplied with the Gnome desktop.For the Mac, there are quite a few editors out there, some free some not, none are really on par with Ultraedit featurewise, but this could be seen as a plus in some respects. I was quite happy using TextMate for web development work, especially as it had plugins available for code browsing and project handling, that is, until I found Coda.Coda, takes up where other editors on the Mac finish, and whilst it may only be aimed at web development, it includes everything that you might need in the day to day life of a web dev.Coda integrates the most useful programs all into one single IDE, it includes project management, an FTP client, text editor, preview window, css editor, SVN client and even a terminal window for remote access to your web server.The Project management features allows you to keep local and remote server details, as well as FTP and SSH login details all together, meaning that when working on a project it is easy to upload / download files, check the results of your work in the inbuilt browser, edit css etc. There is even a built in book library that includes books for HTML, Javascript, CSS and PHP, There is also the ability to add more if you so wish. The in built code navigator allows quick access to classes and functions, and with the addition of a few extra plugins you can also validate your PHP code, and perform other actions such as HTML tidying and url encoding. All of this is in addition to the standard expcted features of any decent editor such as tabbed MDI, syntax highlighting, find in files, text commenting, text conversion and even split window editing.Coda is not a free application, but does offer a free demo. If you're in the market for a decent development platform for web apps, then give Coda a try, I'm sure that you will not be  dissapointed.Coda is available from Panic software at http://www.panic.com/coda/ DM

  4152 Hits
  0 Comments
4152 Hits
0 Comments