I develop a jQuery plugin which produces HTML output, currently something like
<ul>
<li><img></img></li>
...
</ul>
But actually, I would like to let the user of my plugin chose the HTML markup which gets generated, so for instance he passes a template string from which my plugin produces the output. But I don't know how.
Are there any best practices / "patterns" on how to achieve such a functionality?