This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.

Friday, August 17, 2007

Purple Include Update

  • I integrated Purple Include and Blogger
  • I pushed a small new update today that fixes some address parsing bugs for complex XPath 2.0 expressions -- these are automatically on the server, so you don't have to do anything. I also updated the JavaScript to ease the Blogger integration a bit (added some extra styling to the spinner image and a class name)
  • I forgot to mention in my post yesterday that Purple Include can now take XPath 2.0 expressions (the old one could only do XPath 1.0 stuff)
  • Purple Include works on the iPhone!

Labels: , , ,


// posted by Brad GNUberg @ Friday, August 17, 2007 2 Comments Links to this post

Purple Include Test of Blogger Integration

This is a test post using a Purple Include to get it working on my blog. Here is a paragraph from my Paper Airplane, um, paper from a few years ago:



You should see some paragraphs above; all I had to do was add a script tag to the top of my Blogger template:

<script src="http://codinginparadise.org/projects/purple-include/purple-include.js"
type="text/javascript"></script>

I also added some default styles to my blog template; Purple Include automatically adds some class names when it embeds something and if there is an error that we can style on:

<style>
.included{ display: block; padding-left: 2em; padding-right: 2em; background-color: #486F6F; }
.include_error{ display: block; background-color: red; text-color: black; }
.include_roller{ border: none; }
.included p{ margin-top: 1em; margin-bottom: 1em; }
</style>

Here's the tag I added above to include things:

<div href="http://codinginparadise.org/paperairplane#xpath(for $i in (4 to 10) return //p[$i])"></div>

The XPath expression is an XPath 2.0 expression:

for $i in (4 to 10) return //p[$i]

This basically just returns a range of paragraph nodes, from the 4th to the 10th one, which is the Introduction part of the Paper Airplane paper.

Labels: ,


// posted by Brad GNUberg @ Friday, August 17, 2007 3 Comments Links to this post

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]

AltStyle によって変換されたページ (->オリジナル) /