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

Labels: , , ,


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: ,


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

Subscribe to Posts [Atom]