HubSpot/shepherd — pull request #25 by azaslavsky (2014-11-05 11:26:18+00:00)
Title: Added two new types to Step.text property

Love this tour system, bar none the best one out there IMO. I've made a few small modifications in my personal use, thought I'd share if y'all don't mind.

As it stands, Step.text can be either a string or an array of strings. I've found it very useful to be able to append either a templating function or a full-on DOM Node to the div.shepherd-text element. This gives a lot more flexibility than simply providing text to be added. For example, by passing a template building function to Step.text, one can:

-Create a DOM Node that has some bound event (a jQuery animation perhaps)
-Dynamically modify the content of the text (if the user has X messages and we are giving them the a tour of the message system, we can reference that number directly)
-Mess with HTML hierarchy, instead of just straight paragraphs
-Pre-create a text field shared by multiple tours or steps, then append it when the step in question is shown

I understand if this falls outside the scope of the project (the content could become to broad to deal with, users could easily insert memory leaks, etc), but I've found this to be incredibly useful.