snippet-helper
v1.0.1
Published
An utility library for loading code snippets with Prism highlighting support.
Maintainers
Readme
Snippet Helper Plugin
The Snippet Helper utility library offers some methods to load code snippets into pages.
Features
- Loads code snippets
- Supports Prism highlighting when available.
- Free to use under MIT
Installation
Via Bower:
bower install snippet-helperVia npm:
npm install snippet-helperIn a browser:
<script src="snippet-helper.js"></script>Getting Started
Include jQuery and the plug-in on a page. Create the snippets that should be available under 'snippets' directory and call snippetHelper.loadSnippets
<script type="text/javascript">
var snippets = [
{code:"code-ezp-05", ext:"html,js"},
{code:"code-ezp-01", ext:"html"}
];
$(document).ready(function () {
loadSnippets(snippets);
});
</script>For more information on how to setup and customise, check the examples.
License
Licensed under MIT license.
