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: announcement, hypertext, hypertext geekery, purple include
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:
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.
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: hypertext geekery, purple include
Subscribe to Posts [Atom]