1.0.1 • Published 9 years ago

snippet-helper v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

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-helper

Via npm:

npm install snippet-helper

In 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.