Edit: Editing for clarity and actual use. Actual use might even make this situation easier?
I'm building a style guide and I want to include source code to the common styles/patterns for people who will be using the guide. My plan is to abstract out all the heavy HTML code modules into external files and pull them in using jQuery then use SyntaxHighlighter to highlight what's being presented on the screen. The HTML below shows my intent and what I'd like to do.
I've removed all JavaScript for now since it doesn't add any value to the question at hand. I'll update with anything I come up with.
<div class="sg-section">
<div class="sg-section-body">
<div data-load="markup/pagination.html"></div>
</div>
<div class="sg-section-code">
<small>Source Code</small>
<pre class="brush: js">
<!-- This is where I want to print out the contents -->
<!-- of the 'sg-section body' above and show it's source -->
</pre>
</div>
</div>
I can get the data loaded with a simple $('[data-load]'.each();
statement, but I'm having a hard time printing the result out into sg-section-code
and getting it hightlighted.
Conclusion: Switched to Prism. Works beautifully.