I happened to be working with the amazing Adeline Koh today in a support ticket and stumbled on some really interesting work she's doing for a client and asked her if she would mind me blogging it because it's a pretty clever solution to marking up documents in WordPress. Adeline has been a huge supporter of Reclaim Hosting and I love supporting the work she does to help others wrestle with the nitty gritty of managing a space online.
She was working on a site that had inline commenting enabled via the Inline Comments plugin which was new to me. In the past in order to accomplish per-paragraph comments for markup I've had to recommend CommentPress which is frankly a pretty poor interface and since it's bundled as a theme it overrides all styling on the site for what is essentially a single feature. Inline Commenting seems to do this out of the box and it's pretty slick.
Adding a library is usually as easy as copying the minified code and pasting it between some script tags. Where it gets tricky is that many libraries depend on jQuery and while WordPress comes with jQuery loaded by default it can be a pain to get it to play nice with new scripts. In this instance I had to modify the example script that read:
and paste it as
I happened upon that solution from this StackOverflow article by the way and it seems to have worked a treat. For my example here I'm breaking out every sentence into a comment-enabled block that can be activated by highlighting and clicking the + icon.
Styling could use some work with this solution as I think with per word or per sentence comments it tends to get a bit overwhelming, but I thought it was a really interesting solution to the question of document markup in WordPress (of which I'm sure there are many more ways to skin that cat) and so I wanted to write it up for those who might find either plugin useful in tricking out their WordPress installation. If you'd like to play with the example check out the demo site I put together to test this at http://timowens.stateu.org/comments/.