Archive for the ‘Markup’ Category

Is it true? A decent JavaScript editor?

Of all the software I have on my Mac, I’ve always been missing a decent JavaScript editor. I do have editors that support JavaScript syntax highlighting and such but they lack those extra features. For other languages such as:

  • CSS I have CSSEdit and StyleMaster,
  • PHP I have Zend Studio and it’s wonderful developing environment,
  • HTML, JavaScript and general code editing I have the awsome BBedit,
  • and for general subversion access there’s svnX.

(note the lack of a WYSIWYG editor! Everything by hand!)

But I really want a good JavaScript IDE. And I may have found one. A colleague pointed me at Aptana, I just downloaded it and gave it a quick try and looks very promising:

aptana_test.jpg

My only complaint is that it’s written in Java so it doesn’t use the standard windowing methods on my Mac but I can look past that if it’s good enough. Hopefully this will now complete my tool set.

24 Ways: CSS Production Notes from Subversion

I came across a great article about creating CSS production notes by Andy Clark. It’s a great idea to show co-workers the information and notes about a file but in my production environment I often use subversion so I’ve merged the two. If you use subversion and a dynamic language such as PHP there’s no reason why you can’t show the subversion log for the current file in the same way. Here’s a quick little PHP script that does exactly that. Feel free to use and edit it as much as you like, just let me know if you make a big improvement so I can post it here. Enjoy:

<?php

/**
 * A quick PHP script to produce the notes markup from subversion logs.
 * @see http://24ways.org/2006/css-production-notes
 */

//the current file in the repository, you could use $_SERVER['PHP_SELF']
$file = '/home/jeff/subversion/myproject/trunk/index.php';

//retrieve the log from subversion
$exec = array(
        'cmd'=> 'svn log --xml --verbose ' . escapeshellarg($file), //command
        'output'=>null,
        'return'=>null
);
exec($exec['cmd'],$exec['output'],$exec['errors']);

//make it a string.
$log = join($exec['output']);

//create the notes
$notes = '';
$xml = new SimpleXMLElement($log);

//build the notes
foreach ($xml->xpath('//logentry') as $entry) {
    $message = nl2br($entry->msg);

    $notes .=
<<<NOTE
<li>
    <blockquote cite="{$entry->author}">
        <p>{$message}</p>
        <p class="date">{$entry->date}</p>
    </blockquote>
</li>
NOTE;

}

$notes = '<ul>'.$notes.'</ul>';

//do whatever you need with it.
echo $notes;

?>

The Tabular Data Enigma

Did you know that tabular data doesn’t really exist? Yes it’s true! Recently at work, I was discussing the advantages of semantic markup with a colleague and stumbled upon an interesting conundrum. In the conversation, we agreed that table based design layouts are bad, and that tables should be used for tabular data. I think you’ve probably heard the same elsewhere and would probably agree as well. The sticky point however was that my colleague then proceeded to state that the application he was working on, which used <table> tags to markup the output, was semantically correct because it was a file browser of sorts which was ‘tabular data’. I proceeded to point out it would be more correct to use the proper list tags (ordered <ol> or unordered <ul>) as it was a list of files. Frustrated with my response, he asked: “then what is tabular data?” and suddenly I found myself without a clear and concise answer. (more…)

Relativity and Your Web Site

Caution: Paths may explode.I bet, at some point, you’ve come across a broken link or maybe an image that just wasn’t loading properly into your web site. When it comes to linking files, or more specifically, file paths in your web site, everything is relative. But relative to what? The problems associated with relativity become especially apparent when working with dynamically created pages. (more…)

Content & imagery © Copyright 2007 by Jeffrey Sambells as appropriate.