MYOML #4: Creating the Outline

Finally, it's time to start writing some XSLT and putting an actual article together. In this installment of Make Your Own Markup Language the basic XML document structure is created. Once this is in place, we'll be able to freely tweak the individual sections to get the desired result.

Issue #4: Creating the Outline

The Python Tourist: None, empty, and nothing.

Coming from a C background to Python, I made the assumption that Python's None value was to be used much like a NULL pointer in C. Based on this assumption, I happily coded away using patterns like "if not function()", much like you would say "if !fgets(...)" in C. Only after running into some non-obvious bugs did the wisdom of "always explicitly test for None" become clearer to me.

Issue #4: None, empty and nothing.

MYOML #3: Building Blocks

There are two basic things needed when building an XML-based markup language: Containers to put your content in, and a way to visually format those containers. In MYOML #3, the HTML containers <div> and <span> are introduced, CSS classes are explained, and a little demo shows why separating content from presentation is important.

Issue #3: Building Blocks

The Python Tourist: Forgetting how cmp() works!

It seems like each time I create a class that needs to be sorted, I start trying to remember what the return values from __cmp__() are supposed to be ... forgetting that there is an easy way to avoid this completely.

Issue #3: Forgetting how cmp() works ... no problem!

Firefox Session Saver

This is a Firefox extension that auto-saves all tabs when you exit and reloads them when you restart Firefox. Very nice. You probably want to read the user comments at the site linked below, because it sounds like it may have a few weird behaviors (not to mention the confidence-inspiring "version 0.2" label Wink ...).

Link: Firefox Session Saver

The "Developer notes" on the above site recommends getting a newer version from the author's homepage, but it seemed out of date. Hm. The linked version works fine for me.

MYOML #2: Setting Things Up

The second installment of "MYOML: Make Your Own Markup Language" has been posted.

This article sets up the basic "skeleton" files that the rest of the series will be built upon. It introduces some basic XSLT and CSS concepts. It also contains a test page to see if your browser can handle XSLT natively. If not, it shows you how to run an XSLT processor manually.

Issue #2: Setting Things Up

[Python] Gnosis Utils 1.2.1 released

A minor bugfix release of Gnosis_Utils is now available, thanks to Mark Janes for the report.

Source: Gnosis_Utils-1.2.1.tar.gz

Win32 binaries:

MYOML - Make Your Own Markup Language

I vaguely remember writing my first webpage, and thinking that HTML was the greatest invention ever. That enthusiam wore off by about the middle of the second page. I've never liked writing raw HTML because it forces you to spend a large amount of time on presentation, which takes time away from writing the content itself.

This series of articles will show you how to create your own "mini" markup language, using standards and tools like XML, XSLT, CSS and (optionally) a little PHP. If those four acronyms mean nothing to you, don't worry - everything you need to know will be covered here.

Series begins here: First Steps Towards Your Own Markup Language

The Python Tourist: Taking Exception

Thanks to a little insomnia, I had time to mull over and write a second installment in The Python Tourist.

Issue #2: Taking Exception.

This one is about exception handling in Python; primarily about how cool and useful it, but also with some notes about pitfalls you'll want to avoid.

You may notice that the article is a ".php" file this time instead of ".html". The short story is I needed to untabify the HTML before serving it. The long story will be the subject of an upcoming post.

WinSCP and alternatives for Linux

I am an avid Linux user, but there is one utility I've found that (almost, halfway) made me consider switching to Windows: WinSCP. A basic description of the program is that it lets you transfer files to/from a remote host over SFTP (secure FTP, along the same lines as SSH). There are many utilities that do this, but the ease of use of WinSCP really surprised me.

Syndicate content