Socket
Socket
Sign inDemoInstall

snippet-helper

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    snippet-helper

An utility library for loading code snippets with Prism highlighting support.


Version published
Maintainers
1
Created

Readme

Source

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.

Keywords

FAQs

Last updated on 26 Jun 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc