2.1.6 • Published 2 years ago

@acarl005/codeflask v2.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

CodeFlask Mod

npm i '@acarl005/codeflask'

I modified CodeFlask to be able to...

  1. Make PrismJS a peer dependency
  2. Attach (and remove) custom event listeners to the editor
  3. Support the Line Highlight plugin in PrismJS
  4. Fix this issue: kazzkiq/CodeFlask#69
  5. Fix bugs with tab hotkey for indentation
  6. Make the self-closing characters configurable
import CodeFlask from "codeflask"
import Prism from "prismjs"

const flask = new CodeFlask(editor, Prism, {
  language: "js",
  selfClosingCharacters: ['(', '[', '{', "'", '"'],
  customEventListeners: {
    "keydown": e => {
      if (e.key == "Enter") {
        e.preventDefault()
        e.stopImmediatePropagation()
        // do custom stuff
      }
    }
  }
})

flask.highlightLines("4-7")

PrismJS is highly customizable. It actually offers custom builds with more plugins that you can opt into. This is an awesome and rare feature b/c you can minimize the bundle by omitting unneeded functionality. Therefore, it should be a peer dependency, b/c CodeFlask can't know which build with which plugins you'll need.

2.1.2

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.6

2 years ago

2.1.5

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.9

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.4.2

2 years ago