webbie-snippet

1.0.4 • Public • Published

webbie-snippet NPM version NPM monthly downloads NPM total downloads

Add code snippets to your page with this web component.

It's not very versatile, but you can pop a couple of code blocks onto your site without having to manually style and HTML encode your <pre> and <code> tags.


Install

Install with npm: npm install webbie-snippet


Usage

Add script to page with <script type="module" src="path/to/dist/webbie-snippet.js"></script>

<webbie-snippet>
    --- The code/text which will be shown in snippet ---
</webbie-snippet>

Props

All props are optional.

Name Description
dark display snippet in dark mode
numbered show line numbers
manual-spacing space the content as saved in source
enable-copy provides a button to copy code snippet
pre-style custom css for the <pre> tag
button-style custom css for the copy button

Further examples in demo.html

/webbie-snippet/

    Package Sidebar

    Install

    npm i webbie-snippet

    Weekly Downloads

    5

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    5.99 kB

    Total Files

    4

    Last publish

    Collaborators

    • csertheape