Socket
Book a DemoInstallSign in
Socket

@beyonk/svelte-codehighlight

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyonk/svelte-codehighlight

latest
npmnpm
Version
0.0.5
Version published
Weekly downloads
5
-87.18%
Maintainers
1
Weekly downloads
 
Created
Source

Beyonk

Svelte CodeHighlight

by @antony

js-standard-style svelte-v3

About

Provides an interactive code-highlighter for presentations!

Uses highlight.js under the hood.

Roadmap

  • Theme configurability
  • CSS Animations
  • More languges (hljs)

Usage

<script>
  import CodeHighlight from '@beyonk/svelte-codehighlight

  const code = `
    import Foo from 'bar'

    function baz () {
      new Foo()
    }

    const qux = baz()

    console.log('quux', qux)
  `

  const locs = [
    { line: 1 },
    { line: 4 },
    { line: 7 },
    { line: 3, length: 3 },
    { line: 9 }
  ]
</script>

<CodeHighlight {code} {locs} />

Then use [ and ] keys to move between highlighted blocks of code.

Keywords

svelte

FAQs

Package last updated on 26 Sep 2019

Did you know?

Socket

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