SLiP is a shorthand syntax for XML or XML-like data. It's benefits include:
The idea came to me while attending a conference recently. I wanted a way to take notes quickly on my laptop, but also allow me to structure the data so that it could be directly uploaded into a database or other applications. Almost all of the XML editors I have seen to date have been mouse-oriented and require constant back and forth between mouse and keyboard, making it impossible to keep up with the lectures. I wanted something quicker. Then I remembered the Daily Chump IRC bot (http://usefulinc.com/chump/) from the RDF IRC channel and it's technique for logging links directly from IRC. It uses a simple syntax to enter links, titles, and descriptions, and transforms the entries into well-formed XML for rendering in their log (http://rdfig.xmlhack.com/).
The idea of creating a specific syntax for just note-taking occured to me first, but then I felt there was decent utility for a general shorthand mothod for any XML. I had on numerous occaisions pained through making simple text XML files, so I thought what the heck.
As I thought about different syntaxes, I felt that my language of choice right now, Python, would be well suited for the notes I wanted to take. It's a clean, easily readable format, and seems to fit the XML data model very well. It also allows one to use an existing Python editor.
The SLiP syntax isn't quite Python (hence the acronym, SLiP - Sorta Like Python), but is pretty darn close. Here is an example:
root(): #this is an example of SLIP address(type="home"): street(): "123 Sesame Street" city(): "Wonderland" state(): "CA" zipCode(): "90012" comment(): """ Please leave packages with Grouch in garbage can next door. """
This would convert to:
<root> <!-- this is an example of SLIP in action --> <address type="home"> <street>123 Sesame Street</street> <city>Wonderland</city> <state>CA</state> <zipCode>90012</zipCode> <comment>Please leave packages with Grouch in garbage can next door.</comment> </address> </root>
You'll notice that the equivalent of Python function or class names become the element names, parameter pairs become the attributes, any sub-statements become sub-elements and strings become text. It should obey the majority of Python syntax dealing with strings and indentations, but it doesn't use any sort of declarations ("def", "class", "while", etc.) and any actual Python code won't be executed.
If you want more examples or details, I suggest you just give it a try because it's free and I don't feel like writing anymore :) I've built a python library for SLiP (yes, it's free as in MIT license free) that performs transformations between SLiP and XML, along with an editor wrapper that takes XML and allows you to edit it via SLiP syntax in whatever text editor you like, which I so proudly call -- SLIDE (SLiP IDE). It is rough (afterall, I'm a PM, not a Dev), so I'd love to know if you find bugs or gaping holes. Also let me know what you think about it or any ideas you might have. I just built it to help me solve that note-taking problem, so if it helps anybody else, all the better!
OK, OK, fine, here's a few more examples... RDF and RSS
Some RDF from the RDFig logs:
Some RSS from the Jon Udell's Radio blog:
"""probably not, unless I find someone to pay for it."""
# RSS generated by Radio UserLand v8.0.5 on Sun, 31 Mar 2002 05:07:24 GMT
"""Jon Udell's Radio Blog"""
"""Copyright 2002 Jon Udell"""
"""Sun, 31 Mar 2002 05:07:24 GMT"""
"""Teams that communicate with care"""
"""<P><FONT face=Verdana,Geneva,Arial,Helvetica,Sans-Serif size=2>Dave </FONT><A href="http://scriptingnews.userland.com/backissues/2002/03/30#instantOutlineRambles"><FONT face=Verdana,Geneva,Arial,Helvetica,Sans-Serif size=2>writes</FONT></A><FONT face=Verdana,Geneva,Arial,Helvetica,Sans-Serif size=2>:</FONT></P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P><EM><FONT face=Verdana,Geneva,Arial,Helvetica,Sans-Serif size=2>Teams that communicate with care...</FONT></EM></P></BLOCKQUOTE>
<P dir=ltr><FONT face=Verdana,Geneva,Arial,Helvetica,Sans-Serif size=2>That's it in a nutshell. If you had to boil all this down to five words, it's for teams that communicate with care. Email can be used to communicate with care, but it's hard work. Radio aims to make email's best practices easier to achieve.</FONT> </P>
<P dir=ltr> </P>"""
Some RSS from the Jon Udell's Radio blog: