1.0.4 • Published 12 months ago

webbie-snippet v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

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.

NameDescription
darkdisplay snippet in dark mode
numberedshow line numbers
manual-spacingspace the content as saved in source
enable-copyprovides a button to copy code snippet
pre-stylecustom css for the <pre> tag
button-stylecustom css for the copy button

Further examples in demo.html

1.0.4

12 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago