amd - Use PrismJS with RequireJS, even though it's not a dependency -
i'm trying use prismjs while not attaching strict dependency functions. ii needed render syntax highlighting on page but, unfortunately, full styling isn't being passed page.
i did read this thread , confirmed prism
attached window
object, styling isn't showing on page.
here's code (prism.css
concatenated other styles via sass):
the html:
<pre><code class="language-css"> git rm 'myfile.html' </code></pre>`
the script tag:
<script data-main="/js/config.js" src="/js/require.js"></script>
config.js
requirejs.config({ baseurl: "/js", deps: ["prism"], paths: { prism: "vendor/prism" }, shim: { "prism": { "exports": "prism" } } });
prism.js
define("prism", ["prism"],function(prism) { return prism; //probably redundant });
i have feeling doing in prism.js
what's needed, not 100% sure.
most don't need anymore, have stumbled on question while faced similar problem.
what need, likely, prism.highlightall();
function call. solution found @ http://schier.co/blog/2013/01/07/how-to-re-run-prismjs-on-ajax-content.html.
Comments
Post a Comment